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

Unified Diff: Source/platform/graphics/RecordingImageBufferSurface.h

Issue 659873002: Making display list canvases fall back to gpu-accelerated when appropriate (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: response to comments Created 6 years, 2 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/core/html/HTMLCanvasElement.cpp ('k') | Source/platform/graphics/RecordingImageBufferSurface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/RecordingImageBufferSurface.h
diff --git a/Source/platform/graphics/RecordingImageBufferSurface.h b/Source/platform/graphics/RecordingImageBufferSurface.h
index 6bb095c9a8001624f0bbfb9f64d0277394ef0f50..c73a61ea45afac11f0f3719554b8a0b57d0aa6eb 100644
--- a/Source/platform/graphics/RecordingImageBufferSurface.h
+++ b/Source/platform/graphics/RecordingImageBufferSurface.h
@@ -20,10 +20,16 @@ namespace blink {
class ImageBuffer;
+class RecordingImageBufferFallbackSurfaceFactory {
+public:
+ virtual PassOwnPtr<ImageBufferSurface> createSurface(const IntSize&, OpacityMode) = 0;
+ virtual ~RecordingImageBufferFallbackSurfaceFactory() { }
+};
+
class PLATFORM_EXPORT RecordingImageBufferSurface : public ImageBufferSurface {
WTF_MAKE_NONCOPYABLE(RecordingImageBufferSurface); WTF_MAKE_FAST_ALLOCATED;
public:
- RecordingImageBufferSurface(const IntSize&, OpacityMode = NonOpaque);
+ RecordingImageBufferSurface(const IntSize&, PassOwnPtr<RecordingImageBufferFallbackSurfaceFactory> fallbackFactory, OpacityMode = NonOpaque);
virtual ~RecordingImageBufferSurface();
// Implementation of ImageBufferSurface interfaces
@@ -35,6 +41,18 @@ public:
virtual void didClearCanvas() override;
virtual void setImageBuffer(ImageBuffer*) override;
+ // Passthroughs to fallback surface
+ virtual const SkBitmap& bitmap() override;
+ virtual bool restore() override;
+ virtual WebLayer* layer() const override;
+ virtual bool isAccelerated() const override;
+ virtual Platform3DObject getBackingTexture() const override;
+ virtual bool cachedBitmapEnabled() const override;
+ virtual const SkBitmap& cachedBitmap() const override;
+ virtual void invalidateCachedBitmap() override;
+ virtual void updateCachedBitmapIfNeeded() override;
+ virtual void setIsHidden(bool) override;
+
private:
struct StateRec {
public:
@@ -55,10 +73,11 @@ private:
OwnPtr<SkPictureRecorder> m_currentFrame;
RefPtr<SkPicture> m_previousFrame;
- OwnPtr<SkCanvas> m_rasterCanvas;
+ OwnPtr<ImageBufferSurface> m_fallbackSurface;
ImageBuffer* m_imageBuffer;
int m_initialSaveCount;
bool m_frameWasCleared;
+ OwnPtr<RecordingImageBufferFallbackSurfaceFactory> m_fallbackFactory;
};
} // namespace blink
« no previous file with comments | « Source/core/html/HTMLCanvasElement.cpp ('k') | Source/platform/graphics/RecordingImageBufferSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698