Title: [136023] branches/chromium/1312/Source/WebCore/platform/graphics
- Revision
- 136023
- Author
- senorbla...@chromium.org
- Date
- 2012-11-28 10:21:31 -0800 (Wed, 28 Nov 2012)
Log Message
Merge 135809 - [Chromium] Shared graphics context should only pushGroupMarker() once
https://bugs.webkit.org/show_bug.cgi?id=103082
Reviewed by James Robinson.
GraphicsContext3D's pushGroupMarkerEXT() is being called every time
an ImageBuffer is created, leading to unlimited memory growth, since
they share a common GraphicsContext3D. It should be called only once,
on context creation.
See also http://crbug.com/160411.
Tested by manually checking the memory usage in Chrome's TaskManager.
(Sorry, I can't think of a way to test this automatically.)
* platform/graphics/gpu/SharedGraphicsContext3D.cpp:
(WebCore::SharedGraphicsContext3DImpl::getOrCreateContext):
* platform/graphics/skia/ImageBufferSkia.cpp:
(WebCore::createAcceleratedCanvas):
TBR=senorbla...@chromium.org
Review URL: https://codereview.chromium.org/11308248
Modified Paths
Diff
Modified: branches/chromium/1312/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp (136022 => 136023)
--- branches/chromium/1312/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp 2012-11-28 17:53:41 UTC (rev 136022)
+++ branches/chromium/1312/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp 2012-11-28 18:21:31 UTC (rev 136023)
@@ -42,12 +42,19 @@
if (m_context && (!m_context->makeContextCurrent() || (m_context->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR)))
m_context.clear();
- if (!m_context)
+ bool wasCreated = false;
+
+ if (!m_context) {
createContext();
+ wasCreated = true;
+ }
if (m_context && !m_context->makeContextCurrent())
m_context.clear();
+ if (m_context && wasCreated)
+ m_context->getExtensions()->pushGroupMarkerEXT("SharedGraphicsContext");
+
return m_context;
}
Modified: branches/chromium/1312/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp (136022 => 136023)
--- branches/chromium/1312/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp 2012-11-28 17:53:41 UTC (rev 136022)
+++ branches/chromium/1312/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp 2012-11-28 18:21:31 UTC (rev 136023)
@@ -79,7 +79,6 @@
GrContext* gr = context3D->grContext();
if (!gr)
return 0;
- context3D->getExtensions()->pushGroupMarkerEXT("AcceleratedCanvasContext");
gr->resetContext();
GrTextureDesc desc;
desc.fFlags = kRenderTarget_GrTextureFlagBit;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes