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

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

Issue 501353002: Transfer canvas state to the next frame with noticable restrictions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Release Created 6 years, 3 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
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;

Powered by Google App Engine
This is Rietveld 408576698