1. 09 Dec, 2016 3 commits
  2. 08 Dec, 2016 1 commit
  3. 07 Dec, 2016 9 commits
  4. 06 Dec, 2016 3 commits
    • Benjamin Otte's avatar
      wayland: Sync attributes also when drawing with GL · cd2b8983
      Benjamin Otte authored
      Probably syncing attributes shouldn't happen when drawing in the first
      place, but what do I know about Wayland. ¯\_(ツ)_/¯
      cd2b8983
    • Benjamin Otte's avatar
      wayland: Uncomment erroneously commented out code · a85a97c1
      Benjamin Otte authored
      I read the code as if (use_gl) instead of if (!use_gl) and commented it
      out in bddfd7bb. That broke drawing on
      Wayland without OpenGL completely.
      
      Whoops.
      
      Now it's back.
      a85a97c1
    • Chun-wei Fan's avatar
      GDK/Win32: Fix build after GDKGL refactoring · 060365a9
      Chun-wei Fan authored
      There were some parts that need some updates after the refactoring in
      GDKGL, so that the code will continue to build and run.
      
      For gdkwindow-win32.c, comment out the parts where we check for use_gl
      (which was removed), since we are going to move all drawing to OpenGL,
      but don't remove/disable the whole portion as that transition is not
      complete at this point.
      
      There a is new GDKGL function that checks for the damaged area of the back
      buffer, but since the notion of "damage" is for *NIX (GLX/EGL for
      Wayland/mir), meaning that there is no such extension for Windows in this
      regard, so we can't support this on Windows as-is, at least for now.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=773299
      060365a9
  5. 05 Dec, 2016 24 commits
    • Piotr Drąg's avatar
      Update POTFILES.in · 82401032
      Piotr Drąg authored
      82401032
    • William Hua's avatar
    • William Hua's avatar
      mir: fix type warning · 3c2aefdd
      William Hua authored
      3c2aefdd
    • William Hua's avatar
      mir: fix build failures · 32b3928e
      William Hua authored
      32b3928e
    • William Hua's avatar
      mir: implement display monitor vfuncs · e27e8e6e
      William Hua authored
      e27e8e6e
    • Benjamin Otte's avatar
      gdkgl: Add gdk_gl_context_get_damage() · 8915be00
      Benjamin Otte authored
      This is a way to query the damaged area of the backbuffer.
      
      The GL renderer uses this to compute the extents of that damage region
      (computed via buffer age) and use them to minimize the area to redraw.
      
      This changes the semantics of GL rendering to "When calling
      gdk_window_begin_frame() with a GL context, the area by
      gdk_gl_context_get_damage() needs to be redrawn and every other pixel of
      the backbuffer is guaranteed to be correct.
      After gdk_window_end_frame() on a GL-drawn window, the whole backbuffer
      must be correct.
      
      We can always glXBufferSwap() now because of this.
      8915be00
    • Benjamin Otte's avatar
      inspector: Add support for displayin the render region · 582ea50f
      Benjamin Otte authored
      Now I just need a UI designer that makes this look nice...
      582ea50f
    • Benjamin Otte's avatar
      glrenderer: Always redraw the whole screen · 9597caef
      Benjamin Otte authored
      9597caef
    • Benjamin Otte's avatar
      gdk: Make gdk_window_begin_draw_frame() take a draw context · ca78f5d3
      Benjamin Otte authored
      ... instead of a gl context.
      
      This requires some refactoring in the way we mark the shared context as
      drawing: We now call begin_frame/end_frame() on it and ignore the call
      on the main context.
      Unfortunately we need to do this check in all vfuncs, which sucks. But I
      haven't found a better way.
      ca78f5d3
    • Benjamin Otte's avatar
      gskrenderer: Add gsk_renderer_begin_draw_frame() · 60567db4
      Benjamin Otte authored
      This way, we can hijack the begin/end draw process and do out own
      processing before passing it on to GDK.
      60567db4
    • Benjamin Otte's avatar
      inspector: Pass the drawing context into the recorder · e950a519
      Benjamin Otte authored
      That way we can capture both the actual changes (clip region) and the
      area that was redrawn (render region), which in OpenGL might not be
      identical.
      
      Nothing shows the render region yet though...
      e950a519
    • Benjamin Otte's avatar
      glrenderer: Always redraw the whole screen · 358aca9e
      Benjamin Otte authored
      358aca9e
    • Benjamin Otte's avatar
      gsk: Change GSK_USE_SOFTWARE env var to GSK_RENDERER · da8d886b
      Benjamin Otte authored
      This way, we can use the variable as more than a boolean flag.
      
      This will be useful for Vulkan or D3D renderers.
      da8d886b
    • Benjamin Otte's avatar
      725a7236
    • Benjamin Otte's avatar
      gdk: Add GdkDrawContext · db8e3065
      Benjamin Otte authored
      This will be the base class for GdkVulkanContext and GdkGLContext.
      db8e3065
    • Benjamin Otte's avatar
      gdk: Redo GL drawing · e38bd27d
      Benjamin Otte authored
      Reenable GL drawing, but do it without Cairo.
      
      Now, the context passed to gdk_window_begin_draw_frame() decides how
      drawing is going to happen. If it is NULL, Cairo is used like before.
      
      If a context is passed, Cairo may not be used for drawing and
      gdk_drawing_context_get_cairo_context() is going to return NULL.
      Instead, the GL renderer must draw to the GL backbuffer and
      end_draw_frame() is then swapping that to the front.
      
      The GskGLRenderer has lost the texture it used to render to and adapted
      to render directly to the backbuffer instead.
      
      The only thing missing is for GtkGLArea to gain back a performant way to
      render. But it didn't have one since the introduction of GSK, this
      patchset doesn't change anything about it.
      
      The new rendering avoids two indirections (the GSK renderer's texture
      and the GDK double buffering surface).
      It improves icon count in the fishbowl demo by 30%.
      e38bd27d
    • Benjamin Otte's avatar
      glcontext: Make begin/end_draw() paired · e87b4721
      Benjamin Otte authored
      This way, we can query the GL context's state via
      gdk_gl_context_is_drawing().
      
      Use this function to make GL contexts as attached and grant them access
      to the front/backbuffer for rendering.
      
      All of this is still unused because GL drawing is still disabled.
      e87b4721
    • Benjamin Otte's avatar
      gdk: Large GL refactoring · 182d18bc
      Benjamin Otte authored
      No visible changes as GL rendering is disabled at the moment.
      
      What was done:
      
      1. Move window->invalidate_for_new_frame to glcontext->begin_frame
      This moves the code to where it is used (the GLContext) and prepares it
      for being called where it is used when actually beginning to draw the
      frame.
      
      2. Get rid of buffer-age usage
      We want to let the application render directly to the backbuffer.
      Because of that, we cannot make any assumptions about the contents the
      application renders outside the clip area.
      In particular GskGLRenderer renders random stuff there but not actual
      contents.
      
      3. Pass the actual GL context
      Previously, we passed the shared context to end_frame, now we pass the
      actual GL context that the application uses for rendering. This is so
      that the vfuncs could prepare the actual contexts for rendering (they
      don't currently).
      
      4. Simplify the code
      The previous code set up the final drawing method in begin_frame.
      Instead, we now just ensure the clip area is something we can render
      and decide on the actual method in end_frame.
      This is both more robust (we can change the clip area in between if we
      want to) and less code.
      182d18bc
    • Benjamin Otte's avatar
      gsk: Allow 0 for gsk_gl_driver_begin_frame() · 4b484557
      Benjamin Otte authored
      Special-case this situation to unset the current framebuffer and render
      to the backbuffer again.
      4b484557
    • Benjamin Otte's avatar
      gdk: Don't recurse when processing updates · 4967257f
      Benjamin Otte authored
      We don't need to send expose events for backwards compatibility anymore.
      4967257f
    • Benjamin Otte's avatar
      gdk: Remove all code that only existed because of use_gl · bddfd7bb
      Benjamin Otte authored
      Now that we don't use GL anymore, this code is unnecessary.
      bddfd7bb
    • Benjamin Otte's avatar
      gdk: Never draw with GL · 77d336de
      Benjamin Otte authored
      This is a temporary switch-off of the GL dawing code that will make
      things keep running. All GL related code (like the GSK renderer or
      GtkGLArea will now fall back to software.
      77d336de
    • Benjamin Otte's avatar
      gskrenderer: Store the GL context · e42e2730
      Benjamin Otte authored
      And use it to create the drawing context with it.
      
      Note that this doesn't yet have any effect and is all infrastructure
      preparation work.
      e42e2730
    • Benjamin Otte's avatar
      API: Require passing a GLContext to begin_draw_frame() · 332ed7be
      Benjamin Otte authored
      This is in preparation for requiring explicit passing of GL contexts
      when drawing.
      332ed7be