OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef RecordingImageBufferSurface_h | 5 #ifndef RecordingImageBufferSurface_h |
6 #define RecordingImageBufferSurface_h | 6 #define RecordingImageBufferSurface_h |
7 | 7 |
8 #include "platform/graphics/ImageBufferSurface.h" | 8 #include "platform/graphics/ImageBufferSurface.h" |
9 #include "public/platform/WebThread.h" | 9 #include "public/platform/WebThread.h" |
10 #include "third_party/skia/include/core/SkDeque.h" | |
10 #include "wtf/OwnPtr.h" | 11 #include "wtf/OwnPtr.h" |
11 #include "wtf/RefPtr.h" | 12 #include "wtf/RefPtr.h" |
12 | 13 |
13 class SkPicture; | 14 class SkPicture; |
14 class SkPictureRecorder; | 15 class SkPictureRecorder; |
15 class RecordingImageBufferSurfaceTest; | 16 class RecordingImageBufferSurfaceTest; |
16 | 17 |
17 namespace blink { | 18 namespace blink { |
18 | 19 |
19 class ImageBuffer; | 20 class ImageBuffer; |
(...skipping 12 matching lines...) Expand all Loading... | |
32 virtual void finalizeFrame() OVERRIDE; | 33 virtual void finalizeFrame() OVERRIDE; |
33 virtual void didClearCanvas() OVERRIDE; | 34 virtual void didClearCanvas() OVERRIDE; |
34 virtual void setImageBuffer(ImageBuffer*) OVERRIDE; | 35 virtual void setImageBuffer(ImageBuffer*) OVERRIDE; |
35 | 36 |
36 private: | 37 private: |
37 friend class ::RecordingImageBufferSurfaceTest; // for unit testing | 38 friend class ::RecordingImageBufferSurfaceTest; // for unit testing |
38 void fallBackToRasterCanvas(); | 39 void fallBackToRasterCanvas(); |
39 void initializeCurrentFrame(); | 40 void initializeCurrentFrame(); |
40 bool finalizeFrameInternal(); | 41 bool finalizeFrameInternal(); |
41 | 42 |
43 // saves current clip and transform matrix of canvas | |
44 bool saveState(SkCanvas*); | |
45 // we should make sure that we can transfer state in saveState | |
46 void setCurrentState(SkCanvas*); | |
47 | |
42 OwnPtr<SkPictureRecorder> m_currentFrame; | 48 OwnPtr<SkPictureRecorder> m_currentFrame; |
43 RefPtr<SkPicture> m_previousFrame; | 49 RefPtr<SkPicture> m_previousFrame; |
44 OwnPtr<SkCanvas> m_rasterCanvas; | 50 OwnPtr<SkCanvas> m_rasterCanvas; |
45 ImageBuffer* m_imageBuffer; | 51 ImageBuffer* m_imageBuffer; |
46 int m_initialSaveCount; | 52 int m_initialSaveCount; |
47 bool m_frameWasCleared; | 53 bool m_frameWasCleared; |
54 | |
55 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
| |
56 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.
| |
57 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.
| |
48 }; | 58 }; |
49 | 59 |
50 } // namespace blink | 60 } // namespace blink |
51 | 61 |
52 #endif | 62 #endif |
OLD | NEW |