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

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: [WIP] first patch to check my approach Created 6 years, 4 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..f3e52b060c87a403755180d9f7193e29c63bcb1b 100644
--- a/Source/platform/graphics/RecordingImageBufferSurface.h
+++ b/Source/platform/graphics/RecordingImageBufferSurface.h
@@ -7,6 +7,7 @@
#include "platform/graphics/ImageBufferSurface.h"
#include "public/platform/WebThread.h"
+#include "third_party/skia/include/core/SkDeque.h"
#include "wtf/OwnPtr.h"
#include "wtf/RefPtr.h"
@@ -39,12 +40,21 @@ private:
void initializeCurrentFrame();
bool finalizeFrameInternal();
+ // saves current clip and transform matrix of canvas
+ bool saveState(SkCanvas*);
+ // we should make sure that we can transfer state in saveState
+ void setCurrentState(SkCanvas*);
+
OwnPtr<SkPictureRecorder> m_currentFrame;
RefPtr<SkPicture> m_previousFrame;
OwnPtr<SkCanvas> m_rasterCanvas;
ImageBuffer* m_imageBuffer;
int m_initialSaveCount;
bool m_frameWasCleared;
+
+ struct StateRec;
Justin Novosad 2014/08/26 16:57:20 This does not need to be forward declared since it
Sergey 2014/08/28 09:55:34 Actually, the intention was to make it inner class
+ SkDeque m_stateStack;
Justin Novosad 2014/08/26 16:57:20 This does not need to be a member of RecordingImag
Sergey 2014/08/28 09:55:34 Done.
+ uint32_t m_stateStackStorage[32];
Justin Novosad 2014/08/26 16:57:20 After you move this into the cpp. The 32 should be
Sergey 2014/08/28 09:55:34 Done.
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698