[chromium] Plumb through partial swap
authorfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Nov 2011 16:30:49 +0000 (16:30 +0000)
committerfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Nov 2011 16:30:49 +0000 (16:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72028

Patch by Jonathan Backer <backer@chromium.org> on 2011-11-14
Reviewed by Kenneth Russell.

Source/WebCore:

* platform/graphics/chromium/Extensions3DChromium.h:
* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::initialize):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore::LayerRendererCapabilities::LayerRendererCapabilities):

Source/WebKit/chromium:

* public/WebGraphicsContext3D.h:
* src/Extensions3DChromium.cpp:
(WebCore::Extensions3DChromium::postSubBufferCHROMIUM):
* src/GraphicsContext3DChromium.cpp:
* src/GraphicsContext3DPrivate.h:
* tests/MockWebGraphicsContext3D.h:
(WebKit::MockWebGraphicsContext3D::postSubBufferCHROMIUM):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100146 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebGraphicsContext3D.h
Source/WebKit/chromium/src/Extensions3DChromium.cpp
Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp
Source/WebKit/chromium/src/GraphicsContext3DPrivate.h
Source/WebKit/chromium/tests/MockWebGraphicsContext3D.h

index aaf7dd55c9f5e2e7f5fe48030c37ef8994dd2a09..e979db4de4831935c0edb8d453e1698e0d31db37 100644 (file)
@@ -1,3 +1,16 @@
+2011-11-14  Jonathan Backer  <backer@chromium.org>
+
+        [chromium] Plumb through partial swap
+        https://bugs.webkit.org/show_bug.cgi?id=72028
+
+        Reviewed by Kenneth Russell.
+
+        * platform/graphics/chromium/Extensions3DChromium.h:
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::initialize):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+        (WebCore::LayerRendererCapabilities::LayerRendererCapabilities):
+
 2011-11-14  Andrey Kosyakov  <caseq@chromium.org>
 
         Web Inspector: expose iframe window to the onShown event handler of panels & sidebars
index 86ebcbe7c467e8fd36ced657e7e379dccdca4c10..96c7f10793e2b89f16d32ad7d5bb0ca88de77b71 100644 (file)
@@ -40,6 +40,7 @@ public:
     // Supported extensions:
     //   GL_CHROMIUM_resource_safe  : indicating that textures/renderbuffers are always initialized before read/write.
     //   GL_CHROMIUM_strict_attribs : indicating a GL error is generated for out-of-bounds buffer accesses.
+    //   GL_CHROMIUM_post_sub_buffer
     //   GL_CHROMIUM_map_sub
     //   GL_CHROMIUM_swapbuffers_complete_callback
     //   GL_CHROMIUM_rate_limit_offscreen_context
@@ -64,6 +65,9 @@ public:
         WRITE_ONLY = 0x88B9
     };
 
+    // GL_CHROMIUM_post_sub_buffer
+    void postSubBufferCHROMIUM(int x, int y, int width, int height);
+
     // GL_CHROMIUM_map_sub
     void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access);
     void unmapBufferSubDataCHROMIUM(const void*);
index c150e37baf0b20acc326b0e1bde82b7026ca1600..7fda8cae2afd25aae3f1575af6b5508fa9aefebb 100644 (file)
@@ -187,6 +187,10 @@ bool LayerRendererChromium::initialize()
         m_capabilities.usingAcceleratedPainting = true;
 
     WebCore::Extensions3D* extensions = m_context->getExtensions();
+    m_capabilities.usingPostSubBuffer = extensions->supports("GL_CHROMIUM_post_sub_buffer");
+    if (m_capabilities.usingPostSubBuffer)
+        extensions->ensureEnabled("GL_CHROMIUM_post_sub_buffer");
+
     m_capabilities.usingMapSub = extensions->supports("GL_CHROMIUM_map_sub");
     if (m_capabilities.usingMapSub)
         extensions->ensureEnabled("GL_CHROMIUM_map_sub");
index 7519545e17504b6a24cc1a742896a681a752794e..796a20f267de78534390f22b1dfec677650315ed 100644 (file)
@@ -85,6 +85,7 @@ struct CCSettings {
 struct LayerRendererCapabilities {
     LayerRendererCapabilities()
         : bestTextureFormat(0)
+        , usingPostSubBuffer(false)
         , usingMapSub(false)
         , usingAcceleratedPainting(false)
         , usingSetVisibility(false)
@@ -92,6 +93,7 @@ struct LayerRendererCapabilities {
         , maxTextureSize(0) { }
 
     GC3Denum bestTextureFormat;
+    bool usingPostSubBuffer;
     bool usingMapSub;
     bool usingAcceleratedPainting;
     bool usingSetVisibility;
index 460524631fedd4a324d28c35a0464ce3adaad57a..68f90f6f87048b58747c45161480b45e8f4f076d 100644 (file)
@@ -1,3 +1,18 @@
+2011-11-14  Jonathan Backer  <backer@chromium.org>
+
+        [chromium] Plumb through partial swap
+        https://bugs.webkit.org/show_bug.cgi?id=72028
+
+        Reviewed by Kenneth Russell.
+
+        * public/WebGraphicsContext3D.h:
+        * src/Extensions3DChromium.cpp:
+        (WebCore::Extensions3DChromium::postSubBufferCHROMIUM):
+        * src/GraphicsContext3DChromium.cpp:
+        * src/GraphicsContext3DPrivate.h:
+        * tests/MockWebGraphicsContext3D.h:
+        (WebKit::MockWebGraphicsContext3D::postSubBufferCHROMIUM):
+
 2011-11-14  Iain Merrick  <husky@google.com>
 
         [chromium] Fix incorrect usage of ASSERT in CCLayerTreeHostTest
index 42c3d0dc160453233f8d5f7bd5cdc63835aaf744..45075988324617584db940a6316632ecc0b12909 100644 (file)
@@ -163,6 +163,9 @@ public:
     // context to the corresponding texture used by the compositor.
     virtual void prepareTexture() = 0;
 
+    // GL_CHROMIUM_post_sub_buffer - Copies part of the back buffer to the front buffer.
+    virtual void postSubBufferCHROMIUM(int x, int y, int width, int height) = 0;
+
     // Synthesizes an OpenGL error which will be returned from a
     // later call to getError. This is used to emulate OpenGL ES
     // 2.0 behavior on the desktop and to enforce additional error
index f06107c3fe643a81e8b6c9843b134b78e929dfd8..737d73f40f96f6f6b281d09b7fd41026fb20ad58 100644 (file)
@@ -77,6 +77,11 @@ void Extensions3DChromium::renderbufferStorageMultisample(unsigned long target,
     m_private->renderbufferStorageMultisampleCHROMIUM(target, samples, internalformat, width, height);
 }
 
+void Extensions3DChromium::postSubBufferCHROMIUM(int x, int y, int width, int height)
+{
+    m_private->postSubBufferCHROMIUM(x, y, width, height);
+}
+
 void* Extensions3DChromium::mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access)
 {
     return m_private->mapBufferSubDataCHROMIUM(target, offset, size, access);
index 4e62e428a60c7b3185fd04570e34fed74b3c1a07..f827f17b065ffd91980be1435154c97eae5a2515 100644 (file)
@@ -882,6 +882,8 @@ bool GraphicsContext3DPrivate::isExtensionEnabled(const String& name)
     return m_enabledExtensions.contains(mappedName);
 }
 
+DELEGATE_TO_IMPL_4(postSubBufferCHROMIUM, int, int, int, int)
+
 DELEGATE_TO_IMPL_4R(mapBufferSubDataCHROMIUM, GC3Denum, GC3Dsizeiptr, GC3Dsizei, GC3Denum, void*)
 DELEGATE_TO_IMPL_1(unmapBufferSubDataCHROMIUM, const void*)
 DELEGATE_TO_IMPL_9R(mapTexSubImage2DCHROMIUM, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Denum, GC3Denum, GC3Denum, void*)
index d6fa3dc8d04ad4509a7d956a84ceb1995a409f59..0e384c4896bb651d5c80dc0c0c690796e8c8cd37 100644 (file)
@@ -101,6 +101,9 @@ public:
 
     void prepareTexture();
 
+    // CHROMIUM_post_sub_buffer
+    void postSubBufferCHROMIUM(int x, int y, int width, int height);
+
     bool isGLES2Compliant() const;
 
     void releaseShaderCompiler();
index 87265bcb71487dbca744cf1c3eae1729bec5caf5..c14010f77330c763687116dc720c80f0c05f66db 100644 (file)
@@ -52,6 +52,8 @@ public:
 
     virtual void prepareTexture() { }
 
+    virtual void postSubBufferCHROMIUM(int x, int y, int width, int height) { }
+
     virtual void synthesizeGLError(WGC3Denum) { }
 
     virtual bool isContextLost() { return false; }