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

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: compile error fix 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/UnacceleratedImageBufferSurface.h b/Source/platform/graphics/RecordingImageBufferSurface.h
similarity index 60%
copy from Source/platform/graphics/UnacceleratedImageBufferSurface.h
copy to Source/platform/graphics/RecordingImageBufferSurface.h
index 407cdcbf31149beae3708c49d2048b569b1d86b1..5a8046d8f1e51c43a38937425c7d1bf0921eb6cf 100644
--- a/Source/platform/graphics/UnacceleratedImageBufferSurface.h
+++ b/Source/platform/graphics/RecordingImageBufferSurface.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Google Inc. All rights reserved.
+ * Copyright (c) 2014, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -28,25 +28,41 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef UnacceleratedImageBufferSurface_h
-#define UnacceleratedImageBufferSurface_h
+#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 PLATFORM_EXPORT UnacceleratedImageBufferSurface : public ImageBufferSurface {
- WTF_MAKE_NONCOPYABLE(UnacceleratedImageBufferSurface); WTF_MAKE_FAST_ALLOCATED;
+class PLATFORM_EXPORT RecordingImageBufferSurface : public ImageBufferSurface {
+ WTF_MAKE_NONCOPYABLE(RecordingImageBufferSurface); WTF_MAKE_FAST_ALLOCATED;
public:
- UnacceleratedImageBufferSurface(const IntSize&, OpacityMode = NonOpaque);
- virtual ~UnacceleratedImageBufferSurface() { }
+ RecordingImageBufferSurface(const IntSize&, OpacityMode = NonOpaque);
+ virtual ~RecordingImageBufferSurface();
- virtual SkCanvas* canvas() const OVERRIDE { return m_canvas.get(); }
- virtual bool isValid() const OVERRIDE { return m_canvas; }
+ 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:
- RefPtr<SkCanvas> m_canvas;
+ void fallbackToRasterCanvas();
Stephen White 2014/07/09 20:04:08 Bikeshed: "fallback" is a noun; I'd use "fallBackT
Justin Novosad 2014/07/11 21:16:08 Done.
Stephen White 2014/07/14 15:19:15 Still seems to be "fallback" in the lastest patch?
Justin Novosad 2014/07/17 18:34:14 I changed it everywhere else LOL. That's why all t
+ void initializeCurrentFrame();
+ bool handleOpaqueFrame();
+
+ OwnPtr<SkPictureRecorder> m_currentFrame;
+ RefPtr<SkPicture> m_previousFrame;
+ OwnPtr<SkCanvas> m_rasterCanvas;
+ ImageBuffer* m_imageBuffer;
+ bool m_frameWasCleared;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698