Diff
Modified: trunk/Source/WebCore/ChangeLog (121267 => 121268)
--- trunk/Source/WebCore/ChangeLog 2012-06-26 17:56:46 UTC (rev 121267)
+++ trunk/Source/WebCore/ChangeLog 2012-06-26 18:09:22 UTC (rev 121268)
@@ -1,3 +1,28 @@
+2012-06-26 James Robinson <[email protected]>
+
+ [chromium] Remove dead compositor-related API from GraphicsContext3DPrivate / Extensions3DChromium
+ https://bugs.webkit.org/show_bug.cgi?id=89933
+
+ Reviewed by Kenneth Russell.
+
+ GraphicsContext3DPrivate and Extensions3DChromium had a fair amount of plumbing and boilerplate to support the
+ compositor's use of GraphicsContext3D. A number of extensions, etc, only make sense for a compositor context.
+ Since the compositor doesn't use GC3D any more, these are no longer needed.
+
+ * platform/chromium/support/Extensions3DChromium.cpp:
+ * platform/chromium/support/GraphicsContext3DChromium.cpp:
+ (WebCore::GraphicsContext3D::~GraphicsContext3D):
+ (WebCore::GraphicsContext3D::create):
+ * platform/chromium/support/GraphicsContext3DPrivate.cpp:
+ (WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate):
+ (WebCore::GraphicsContext3DPrivate::createGraphicsContextFromWebContext):
+ (WebCore::GrMemoryAllocationChangedCallbackAdapter::GrMemoryAllocationChangedCallbackAdapter):
+ (WebCore::GraphicsContext3DPrivate::grContext):
+ * platform/chromium/support/GraphicsContext3DPrivate.h:
+ (WebCore):
+ (GraphicsContext3DPrivate):
+ * platform/graphics/chromium/Extensions3DChromium.h:
+
2012-06-26 Yasuhiro Matsuda <[email protected]>
[chromium] Add the workaround of IOSurface-related corruption during readback on Mac OS X.
Modified: trunk/Source/WebCore/platform/chromium/support/Extensions3DChromium.cpp (121267 => 121268)
--- trunk/Source/WebCore/platform/chromium/support/Extensions3DChromium.cpp 2012-06-26 17:56:46 UTC (rev 121267)
+++ trunk/Source/WebCore/platform/chromium/support/Extensions3DChromium.cpp 2012-06-26 18:09:22 UTC (rev 121268)
@@ -73,11 +73,6 @@
m_private->webContext()->renderbufferStorageMultisampleCHROMIUM(target, samples, internalformat, width, height);
}
-void Extensions3DChromium::postSubBufferCHROMIUM(int x, int y, int width, int height)
-{
- m_private->webContext()->postSubBufferCHROMIUM(x, y, width, height);
-}
-
void* Extensions3DChromium::mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access)
{
return m_private->webContext()->mapBufferSubDataCHROMIUM(target, offset, size, access);
@@ -98,26 +93,6 @@
m_private->webContext()->unmapTexSubImage2DCHROMIUM(data);
}
-void Extensions3DChromium::setVisibilityCHROMIUM(bool visibility)
-{
- m_private->webContext()->setVisibilityCHROMIUM(visibility);
-}
-
-void Extensions3DChromium::discardFramebufferEXT(GC3Denum target, GC3Dsizei numAttachments, const GC3Denum* attachments)
-{
- m_private->webContext()->discardFramebufferEXT(target, numAttachments, attachments);
-}
-
-void Extensions3DChromium::ensureFramebufferCHROMIUM()
-{
- m_private->webContext()->ensureFramebufferCHROMIUM();
-}
-
-void Extensions3DChromium::setGpuMemoryAllocationChangedCallbackCHROMIUM(PassOwnPtr<GpuMemoryAllocationChangedCallbackCHROMIUM> callback)
-{
- m_private->setGpuMemoryAllocationChangedCallbackCHROMIUM(callback);
-}
-
Platform3DObject Extensions3DChromium::createVertexArrayOES()
{
return 0;
@@ -141,11 +116,6 @@
return m_private->webContext()->getTranslatedShaderSourceANGLE(shader);
}
-void Extensions3DChromium::setSwapBuffersCompleteCallbackCHROMIUM(PassOwnPtr<SwapBuffersCompleteCallbackCHROMIUM> callback)
-{
- m_private->setSwapBuffersCompleteCallbackCHROMIUM(callback);
-}
-
void Extensions3DChromium::rateLimitOffscreenContextCHROMIUM()
{
m_private->webContext()->rateLimitOffscreenContextCHROMIUM();
Modified: trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DChromium.cpp (121267 => 121268)
--- trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DChromium.cpp 2012-06-26 17:56:46 UTC (rev 121267)
+++ trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DChromium.cpp 2012-06-26 18:09:22 UTC (rev 121268)
@@ -51,8 +51,6 @@
{
m_private->setContextLostCallback(nullptr);
m_private->setErrorMessageCallback(nullptr);
- m_private->setSwapBuffersCompleteCallbackCHROMIUM(nullptr);
- m_private->setGpuMemoryAllocationChangedCallbackCHROMIUM(nullptr);
}
void GraphicsContext3D::setContextLostCallback(PassOwnPtr<GraphicsContext3D::ContextLostCallback> callback)
@@ -83,7 +81,7 @@
if (!webContext)
return 0;
- return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(webContext.release(), renderStyle, attrs.preserveDrawingBuffer);
+ return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(webContext.release(), attrs.preserveDrawingBuffer);
}
PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D() const
Modified: trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.cpp (121267 => 121268)
--- trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.cpp 2012-06-26 17:56:46 UTC (rev 121267)
+++ trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.cpp 2012-06-26 18:09:22 UTC (rev 121268)
@@ -38,6 +38,7 @@
#include "GrGLInterface.h"
#include "ImageBuffer.h"
#include <public/WebGraphicsContext3D.h>
+#include <public/WebGraphicsMemoryAllocation.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringHash.h>
@@ -68,17 +69,16 @@
GraphicsContext3DPrivate::~GraphicsContext3DPrivate()
{
if (m_grContext) {
+ m_impl->setMemoryAllocationChangedCallbackCHROMIUM(0);
m_grContext->contextDestroyed();
GrSafeUnref(m_grContext);
}
}
-PassRefPtr<GraphicsContext3D> GraphicsContext3DPrivate::createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D> webContext, GraphicsContext3D::RenderStyle renderStyle, bool preserveDrawingBuffer)
+PassRefPtr<GraphicsContext3D> GraphicsContext3DPrivate::createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D> webContext, bool preserveDrawingBuffer)
{
- bool renderDirectlyToHostWindow = renderStyle == GraphicsContext3D::RenderDirectlyToHostWindow;
+ RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(GraphicsContext3D::Attributes(), 0, false /* onscreen */));
- RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(GraphicsContext3D::Attributes(), 0, renderDirectlyToHostWindow));
-
OwnPtr<GraphicsContext3DPrivate> priv = adoptPtr(new GraphicsContext3DPrivate(webContext, preserveDrawingBuffer));
context->m_private = priv.release();
return context.release();
@@ -91,28 +91,27 @@
return context->m_private->webContext();
}
-class GrMemoryAllocationChangedCallback : public Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM {
+class GrMemoryAllocationChangedCallbackAdapter : public WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM {
public:
- GrMemoryAllocationChangedCallback(GraphicsContext3DPrivate* context)
+ GrMemoryAllocationChangedCallbackAdapter(GrContext* context)
: m_context(context)
{
}
- virtual void onGpuMemoryAllocationChanged(Extensions3DChromium::GpuMemoryAllocationCHROMIUM allocation)
+ virtual void onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation allocation) OVERRIDE
{
- GrContext* context = m_context->grContext();
- if (!context)
+ if (!m_context)
return;
if (!allocation.gpuResourceSizeInBytes) {
- context->freeGpuResources();
- context->setTextureCacheLimits(0, 0);
+ m_context->freeGpuResources();
+ m_context->setTextureCacheLimits(0, 0);
} else
- context->setTextureCacheLimits(maxGaneshTextureCacheCount, maxGaneshTextureCacheBytes);
+ m_context->setTextureCacheLimits(maxGaneshTextureCacheCount, maxGaneshTextureCacheBytes);
}
private:
- GraphicsContext3DPrivate* m_context;
+ GrContext* m_context;
};
GrContext* GraphicsContext3DPrivate::grContext()
@@ -122,9 +121,8 @@
m_grContext = GrContext::Create(kOpenGL_Shaders_GrEngine, reinterpret_cast<GrPlatform3DContext>(interface.get()));
if (m_grContext) {
m_grContext->setTextureCacheLimits(maxGaneshTextureCacheCount, maxGaneshTextureCacheBytes);
- Extensions3DChromium* extensions3DChromium = static_cast<Extensions3DChromium*>(getExtensions());
- if (extensions3DChromium->supports("GL_CHROMIUM_gpu_memory_manager"))
- extensions3DChromium->setGpuMemoryAllocationChangedCallbackCHROMIUM(adoptPtr(new GrMemoryAllocationChangedCallback(this)));
+ m_grContextMemoryAllocationCallbackAdapter = adoptPtr(new GrMemoryAllocationChangedCallbackAdapter(m_grContext));
+ m_impl->setMemoryAllocationChangedCallbackCHROMIUM(m_grContextMemoryAllocationCallbackAdapter.get());
}
}
return m_grContext;
@@ -325,55 +323,4 @@
return m_resourceSafety == ResourceSafe;
}
-class GraphicsContext3DMemoryAllocationChangedCallbackAdapter : public WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM {
-public:
- GraphicsContext3DMemoryAllocationChangedCallbackAdapter(PassOwnPtr<Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM> callback)
- : m_memoryAllocationChangedCallback(callback) { }
-
- virtual ~GraphicsContext3DMemoryAllocationChangedCallbackAdapter() { }
-
- virtual void onMemoryAllocationChanged(size_t gpuResourceSizeInBytes)
- {
- // FIXME: Remove this once clients start using WebGraphicsMemoryAllocation exclusively.
- onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation(gpuResourceSizeInBytes, true));
- }
-
- virtual void onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation allocation)
- {
- if (m_memoryAllocationChangedCallback)
- m_memoryAllocationChangedCallback->onGpuMemoryAllocationChanged(Extensions3DChromium::GpuMemoryAllocationCHROMIUM(allocation.gpuResourceSizeInBytes, allocation.suggestHaveBackbuffer));
- }
-
-private:
- OwnPtr<Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM> m_memoryAllocationChangedCallback;
-};
-
-void GraphicsContext3DPrivate::setGpuMemoryAllocationChangedCallbackCHROMIUM(PassOwnPtr<Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM> callback)
-{
- m_memoryAllocationChangedCallbackAdapter = adoptPtr(new GraphicsContext3DMemoryAllocationChangedCallbackAdapter(callback));
- m_impl->setMemoryAllocationChangedCallbackCHROMIUM(m_memoryAllocationChangedCallbackAdapter.get());
-}
-
-class GraphicsContext3DSwapBuffersCompleteCallbackAdapter : public WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffersCompleteCallbackCHROMIUM {
-public:
- GraphicsContext3DSwapBuffersCompleteCallbackAdapter(PassOwnPtr<Extensions3DChromium::SwapBuffersCompleteCallbackCHROMIUM> callback)
- : m_swapBuffersCompleteCallback(callback) { }
- virtual ~GraphicsContext3DSwapBuffersCompleteCallbackAdapter() { }
-
- virtual void onSwapBuffersComplete()
- {
- if (m_swapBuffersCompleteCallback)
- m_swapBuffersCompleteCallback->onSwapBuffersComplete();
- }
-
-private:
- OwnPtr<Extensions3DChromium::SwapBuffersCompleteCallbackCHROMIUM> m_swapBuffersCompleteCallback;
-};
-
-void GraphicsContext3DPrivate::setSwapBuffersCompleteCallbackCHROMIUM(PassOwnPtr<Extensions3DChromium::SwapBuffersCompleteCallbackCHROMIUM> callback)
-{
- m_swapBuffersCompleteCallbackAdapter = adoptPtr(new GraphicsContext3DSwapBuffersCompleteCallbackAdapter(callback));
- m_impl->setSwapBuffersCompleteCallbackCHROMIUM(m_swapBuffersCompleteCallbackAdapter.get());
-}
-
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.h (121267 => 121268)
--- trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.h 2012-06-26 17:56:46 UTC (rev 121267)
+++ trunk/Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.h 2012-06-26 18:09:22 UTC (rev 121268)
@@ -45,15 +45,14 @@
class Extensions3DChromium;
class GraphicsContext3DContextLostCallbackAdapter;
class GraphicsContext3DErrorMessageCallbackAdapter;
-class GraphicsContext3DMemoryAllocationChangedCallbackAdapter;
-class GraphicsContext3DSwapBuffersCompleteCallbackAdapter;
+class GrMemoryAllocationChangedCallbackAdapter;
class GraphicsContext3DPrivate {
public:
// Callers must make the context current before using it AND check that the context was created successfully
// via ContextLost before using the context in any way. Once made current on a thread, the context cannot
// be used on any other thread.
- static PassRefPtr<GraphicsContext3D> createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D>, GraphicsContext3D::RenderStyle, bool preserveDrawingBuffer = false);
+ static PassRefPtr<GraphicsContext3D> createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D>, bool preserveDrawingBuffer = false);
// Helper function to provide access to the lower-level WebGraphicsContext3D,
// which is needed for subordinate contexts like WebGL's to share resources
@@ -83,12 +82,6 @@
bool isResourceSafe();
- // GL_CHROMIUM_gpu_memory_manager
- void setGpuMemoryAllocationChangedCallbackCHROMIUM(PassOwnPtr<Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM>);
-
- // GL_CHROMIUM_swapbuffers_complete_callback
- void setSwapBuffersCompleteCallbackCHROMIUM(PassOwnPtr<Extensions3DChromium::SwapBuffersCompleteCallbackCHROMIUM>);
-
bool preserveDrawingBuffer() const { return m_preserveDrawingBuffer; }
private:
@@ -100,8 +93,7 @@
OwnPtr<Extensions3DChromium> m_extensions;
OwnPtr<GraphicsContext3DContextLostCallbackAdapter> m_contextLostCallbackAdapter;
OwnPtr<GraphicsContext3DErrorMessageCallbackAdapter> m_errorMessageCallbackAdapter;
- OwnPtr<GraphicsContext3DMemoryAllocationChangedCallbackAdapter> m_memoryAllocationChangedCallbackAdapter;
- OwnPtr<GraphicsContext3DSwapBuffersCompleteCallbackAdapter> m_swapBuffersCompleteCallbackAdapter;
+ OwnPtr<GrMemoryAllocationChangedCallbackAdapter> m_grContextMemoryAllocationCallbackAdapter;
bool m_initializedAvailableExtensions;
HashSet<String> m_enabledExtensions;
HashSet<String> m_requestableExtensions;
Modified: trunk/Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h (121267 => 121268)
--- trunk/Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h 2012-06-26 17:56:46 UTC (rev 121267)
+++ trunk/Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h 2012-06-26 18:09:22 UTC (rev 121268)
@@ -90,49 +90,12 @@
COMMANDS_ISSUED_CHROMIUM = 0x84F2
};
- // 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*);
void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access);
void unmapTexSubImage2DCHROMIUM(const void*);
- // GL_CHROMIUM_set_visibility
- void setVisibilityCHROMIUM(bool);
-
- // GL_EXT_discard_framebuffer
- virtual void discardFramebufferEXT(GC3Denum target, GC3Dsizei numAttachments, const GC3Denum* attachments);
- virtual void ensureFramebufferCHROMIUM();
-
- // GL_CHROMIUM_gpu_memory_manager
- struct GpuMemoryAllocationCHROMIUM {
- size_t gpuResourceSizeInBytes;
- bool suggestHaveBackbuffer;
-
- GpuMemoryAllocationCHROMIUM(size_t gpuResourceSizeInBytes, bool suggestHaveBackbuffer)
- : gpuResourceSizeInBytes(gpuResourceSizeInBytes)
- , suggestHaveBackbuffer(suggestHaveBackbuffer)
- {
- }
- };
- class GpuMemoryAllocationChangedCallbackCHROMIUM {
- public:
-
- virtual void onGpuMemoryAllocationChanged(GpuMemoryAllocationCHROMIUM) = 0;
- virtual ~GpuMemoryAllocationChangedCallbackCHROMIUM() { }
- };
- void setGpuMemoryAllocationChangedCallbackCHROMIUM(PassOwnPtr<GpuMemoryAllocationChangedCallbackCHROMIUM>);
-
- // GL_CHROMIUM_swapbuffers_complete_callback
- class SwapBuffersCompleteCallbackCHROMIUM {
- public:
- virtual void onSwapBuffersComplete() = 0;
- virtual ~SwapBuffersCompleteCallbackCHROMIUM() { }
- };
- void setSwapBuffersCompleteCallbackCHROMIUM(PassOwnPtr<SwapBuffersCompleteCallbackCHROMIUM>);
-
// GL_CHROMIUM_rate_limit_offscreen_context
void rateLimitOffscreenContextCHROMIUM();
Modified: trunk/Source/WebKit/chromium/ChangeLog (121267 => 121268)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-06-26 17:56:46 UTC (rev 121267)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-06-26 18:09:22 UTC (rev 121268)
@@ -1,3 +1,13 @@
+2012-06-26 James Robinson <[email protected]>
+
+ [chromium] Remove dead compositor-related API from GraphicsContext3DPrivate / Extensions3DChromium
+ https://bugs.webkit.org/show_bug.cgi?id=89933
+
+ Reviewed by Kenneth Russell.
+
+ * tests/Canvas2DLayerBridgeTest.cpp:
+ (Canvas2DLayerBridgeTest::fullLifecycleTest):
+
2012-06-26 Shawn Singh <[email protected]>
[chromium] Fix incorrect #ifdef WEBKIT_IMPLEMENTATION statements
Modified: trunk/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp (121267 => 121268)
--- trunk/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp 2012-06-26 17:56:46 UTC (rev 121267)
+++ trunk/Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp 2012-06-26 18:09:22 UTC (rev 121268)
@@ -74,7 +74,7 @@
protected:
void fullLifecycleTest(ThreadMode threadMode, DeferralMode deferralMode)
{
- RefPtr<GraphicsContext3D> mainContext = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext), GraphicsContext3D::RenderOffscreen);
+ RefPtr<GraphicsContext3D> mainContext = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext));
OwnPtr<CCGraphicsContext> ccImplContext = CCGraphicsContext::create3D(adoptPtr(new MockCanvasContext));
MockCanvasContext& mainMock = *static_cast<MockCanvasContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(mainContext.get()));
@@ -147,7 +147,7 @@
{
GraphicsContext3D::Attributes attrs;
- RefPtr<GraphicsContext3D> mainContext = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext), GraphicsContext3D::RenderDirectlyToHostWindow);
+ RefPtr<GraphicsContext3D> mainContext = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext));
OwnPtr<Canvas2DLayerBridge> bridge = Canvas2DLayerBridge::create(mainContext.get(), IntSize(100, 100), Deferred, 1);
RefPtr<LayerChromium> layer = bridge->layer();
bridge.clear();