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

Unified Diff: Source/core/platform/graphics/chromium/Canvas2DLayerBridge.h

Issue 16032003: Fixing Canvas2DLayerBridge to handle lost graphics contexts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added assertions on m_layer to verify that init was called Created 7 years, 7 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
Index: Source/core/platform/graphics/chromium/Canvas2DLayerBridge.h
diff --git a/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.h b/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.h
index 510f479e5cd5dda6bfcee6c7e6c3576f1c0bafec..a4f50a00a7c0b3cc37cc546a813431596a853616 100644
--- a/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.h
+++ b/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.h
@@ -37,6 +37,8 @@
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
+class Canvas2DLayerBridgeTest;
+
namespace WebKit {
class WebGraphicsContext3D;
}
@@ -56,10 +58,7 @@ public:
Threaded
};
- static PassOwnPtr<Canvas2DLayerBridge> create(PassRefPtr<GraphicsContext3D> context, SkDeferredCanvas* canvas, OpacityMode opacityMode, ThreadMode threading)
- {
- return adoptPtr(new Canvas2DLayerBridge(context, canvas, opacityMode, threading));
- }
+ static PassOwnPtr<Canvas2DLayerBridge> create(PassRefPtr<GraphicsContext3D>, const IntSize&, OpacityMode, ThreadMode);
virtual ~Canvas2DLayerBridge();
@@ -84,11 +83,16 @@ public:
WebKit::WebLayer* layer();
void contextAcquired();
+ SkCanvas* getCanvas() {return m_canvas;}
Stephen White 2013/05/31 15:06:18 Nit: Missing spaces?
unsigned backBufferTexture();
+ bool isValid();
+
protected:
- Canvas2DLayerBridge(PassRefPtr<GraphicsContext3D>, SkDeferredCanvas*, OpacityMode, ThreadMode);
+ virtual PassRefPtr<GraphicsContext3D> getSharedContext() const; // virtual for faking
+ Canvas2DLayerBridge(PassRefPtr<GraphicsContext3D>, SkDeferredCanvas*);
+ void init(OpacityMode, ThreadMode);
SkDeferredCanvas* m_canvas;
OwnPtr<WebKit::WebExternalTextureLayer> m_layer;
@@ -97,6 +101,8 @@ protected:
bool m_didRecordDrawCommand;
int m_framesPending;
+ friend class ::Canvas2DLayerBridgeTest; // for unit testing
+
friend class WTF::DoublyLinkedListNode<Canvas2DLayerBridge>;
Canvas2DLayerBridge* m_next;
Canvas2DLayerBridge* m_prev;

Powered by Google App Engine
This is Rietveld 408576698