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

Unified Diff: third_party/WebKit/Source/platform/graphics/ImageBuffer.h

Issue 1520123002: Fix state restoration logic in canvas 2d wakeup from hibernation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « third_party/WebKit/Source/platform/graphics/GraphicsTypes.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/ImageBuffer.h
diff --git a/third_party/WebKit/Source/platform/graphics/ImageBuffer.h b/third_party/WebKit/Source/platform/graphics/ImageBuffer.h
index aa17108136fbe427fb20a4d93822f7db5f08804d..5e5d5ea796f9d0f351ddcd4d554920e285913d9a 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageBuffer.h
+++ b/third_party/WebKit/Source/platform/graphics/ImageBuffer.h
@@ -72,7 +72,7 @@ public:
static PassOwnPtr<ImageBuffer> create(const IntSize&, OpacityMode = NonOpaque, ImageInitializationMode = InitializeImagePixels);
static PassOwnPtr<ImageBuffer> create(PassOwnPtr<ImageBufferSurface>);
- ~ImageBuffer();
+ virtual ~ImageBuffer();
void setClient(ImageBufferClient* client) { m_client = client; }
@@ -90,8 +90,9 @@ public:
void setFilterQuality(SkFilterQuality filterQuality) { m_surface->setFilterQuality(filterQuality); }
void setIsHidden(bool hidden) { m_surface->setIsHidden(hidden); }
- // Called by subclasses of ImageBufferSurface to install a new canvas object
- void resetCanvas(SkCanvas*) const;
+ // Called by subclasses of ImageBufferSurface to install a new canvas object.
+ // Virtual for mocking
+ virtual void resetCanvas(SkCanvas*) const;
SkCanvas* canvas() const;
void disableDeferral() const;
@@ -135,9 +136,10 @@ public:
static intptr_t getGlobalGPUMemoryUsage() { return s_globalGPUMemoryUsage; }
intptr_t getGPUMemoryUsage() { return m_gpuMemoryUsage; }
-private:
+protected:
ImageBuffer(PassOwnPtr<ImageBufferSurface>);
+private:
enum SnapshotState {
InitialSnapshotState,
DidAcquireSnapshot,
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/GraphicsTypes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698