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

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

Issue 379253002: Initial implementation of display list backed 2D canvases (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 5 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/platform/graphics/RecordingImageBufferSurface.h
diff --git a/Source/platform/graphics/RecordingImageBufferSurface.h b/Source/platform/graphics/RecordingImageBufferSurface.h
new file mode 100644
index 0000000000000000000000000000000000000000..9c2c6d989c62e2410a17fe4ffb4d428d51655ed1
--- /dev/null
+++ b/Source/platform/graphics/RecordingImageBufferSurface.h
@@ -0,0 +1,47 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef RecordingImageBufferSurface_h
+#define RecordingImageBufferSurface_h
+
+#include "platform/graphics/ImageBufferSurface.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/RefPtr.h"
+
+class SkPicture;
+class SkPictureRecorder;
+
+namespace WebCore {
+
+class GraphicsContext;
+
+class PLATFORM_EXPORT RecordingImageBufferSurface : public ImageBufferSurface {
+ WTF_MAKE_NONCOPYABLE(RecordingImageBufferSurface); WTF_MAKE_FAST_ALLOCATED;
+public:
+ RecordingImageBufferSurface(const IntSize&, OpacityMode = NonOpaque);
+ virtual ~RecordingImageBufferSurface();
+
+ // Implementation of ImageBufferSurface interfaces
+ virtual SkCanvas* canvas() const OVERRIDE;
+ virtual PassRefPtr<SkPicture> getPicture() OVERRIDE;
+ virtual bool isValid() const OVERRIDE { return true; }
+ virtual void willReadback() OVERRIDE;
+ virtual void didClearCanvas() OVERRIDE;
+ virtual void setImageBuffer(ImageBuffer*) OVERRIDE;
+
+private:
+ void fallBackToRasterCanvas();
+ void initializeCurrentFrame();
+ bool handleOpaqueFrame();
+
+ OwnPtr<SkPictureRecorder> m_currentFrame;
+ RefPtr<SkPicture> m_previousFrame;
+ OwnPtr<SkCanvas> m_rasterCanvas;
+ GraphicsContext* m_graphicsContext;
+ bool m_frameWasCleared;
+};
+
+} // namespace WebCore
+
+#endif
« no previous file with comments | « Source/platform/graphics/ImageBufferSurface.cpp ('k') | Source/platform/graphics/RecordingImageBufferSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698