Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Unified Diff: Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h

Issue 9969020: Merge 112568 - [chromium] Ensure framebuffer exists at the start of beginDrawingFrame. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
===================================================================
--- Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h (revision 112692)
+++ Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h (working copy)
@@ -61,6 +61,7 @@
class GeometryBinding;
class GraphicsContext3D;
class LayerRendererSwapBuffersCompleteCallbackAdapter;
+class LayerRendererGpuMemoryAllocationChangedCallbackAdapter;
class ScopedEnsureFramebufferAllocation;
class LayerRendererChromiumClient {
@@ -163,11 +164,12 @@
float width, float height, float opacity, const FloatQuad&,
int matrixLocation, int alphaLocation, int quadLocation);
+protected:
+ friend class LayerRendererGpuMemoryAllocationChangedCallbackAdapter;
void discardFramebuffer();
void ensureFramebuffer();
bool isFramebufferDiscarded() const { return m_isFramebufferDiscarded; }
-protected:
LayerRendererChromium(LayerRendererChromiumClient*, PassRefPtr<GraphicsContext3D>);
bool initialize();
@@ -266,34 +268,7 @@
bool m_isFramebufferDiscarded;
};
-// The purpose of this helper is twofold:
-// 1. To ensure that a framebuffer is available for scope lifetime, and
-// 2. To reset framebuffer allocation to previous state on scope exit.
-// If the framebuffer is recreated, its contents are undefined.
-// FIXME: Prevent/delay discarding framebuffer via any means while any
-// instance of this is alive. At the moment, this isn't an issue.
-class ScopedEnsureFramebufferAllocation {
-public:
- explicit ScopedEnsureFramebufferAllocation(LayerRendererChromium* layerRenderer)
- : m_layerRenderer(layerRenderer)
- , m_framebufferWasInitiallyDiscarded(layerRenderer->isFramebufferDiscarded())
- {
- if (m_framebufferWasInitiallyDiscarded)
- m_layerRenderer->ensureFramebuffer();
- }
- ~ScopedEnsureFramebufferAllocation()
- {
- if (m_framebufferWasInitiallyDiscarded)
- m_layerRenderer->discardFramebuffer();
- }
-
-private:
- LayerRendererChromium* m_layerRenderer;
- bool m_framebufferWasInitiallyDiscarded;
-};
-
-
// Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL
// call made by the compositor. Useful for debugging rendering issues but
// will significantly degrade performance.
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698