Index: Source/platform/graphics/RecordingImageBufferSurface.h |
diff --git a/Source/platform/graphics/RecordingImageBufferSurface.h b/Source/platform/graphics/RecordingImageBufferSurface.h |
index c8af6a045081ddfc38190d3bd03f27eb84842e20..0e4a7d032d499ae214db522a177759d636dea0ce 100644 |
--- a/Source/platform/graphics/RecordingImageBufferSurface.h |
+++ b/Source/platform/graphics/RecordingImageBufferSurface.h |
@@ -7,6 +7,8 @@ |
#include "platform/graphics/ImageBufferSurface.h" |
#include "public/platform/WebThread.h" |
+#include "third_party/skia/include/core/SkCanvas.h" |
+#include "wtf/LinkedStack.h" |
#include "wtf/OwnPtr.h" |
#include "wtf/RefPtr.h" |
@@ -34,11 +36,23 @@ public: |
virtual void setImageBuffer(ImageBuffer*) OVERRIDE; |
private: |
+ struct StateRec { |
+ public: |
+ SkMatrix m_ctm; |
+ // FIXME: handle transferring non-rectangular clip to the new frame, crbug.com/392614 |
+ SkIRect m_clip; |
+ }; |
+ typedef LinkedStack<StateRec> StateStack; |
friend class ::RecordingImageBufferSurfaceTest; // for unit testing |
void fallBackToRasterCanvas(); |
void initializeCurrentFrame(); |
bool finalizeFrameInternal(); |
+ // saves current clip and transform matrix of canvas |
+ bool saveState(SkCanvas*, StateStack*); |
+ // we should make sure that we can transfer state in saveState |
+ void setCurrentState(SkCanvas*, StateStack*); |
+ |
OwnPtr<SkPictureRecorder> m_currentFrame; |
RefPtr<SkPicture> m_previousFrame; |
OwnPtr<SkCanvas> m_rasterCanvas; |