| 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/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 private: | 38 private: |
| 39 struct StateRec { | 39 struct StateRec { |
| 40 public: | 40 public: |
| 41 SkMatrix m_ctm; | 41 SkMatrix m_ctm; |
| 42 // FIXME: handle transferring non-rectangular clip to the new frame, crb
ug.com/392614 | 42 // FIXME: handle transferring non-rectangular clip to the new frame, crb
ug.com/392614 |
| 43 SkIRect m_clip; | 43 SkIRect m_clip; |
| 44 }; | 44 }; |
| 45 typedef LinkedStack<StateRec> StateStack; | 45 typedef LinkedStack<StateRec> StateStack; |
| 46 friend class ::RecordingImageBufferSurfaceTest; // for unit testing | 46 friend class ::RecordingImageBufferSurfaceTest; // for unit testing |
| 47 void fallBackToRasterCanvas(); | 47 void fallBackToRasterCanvas(); |
| 48 void initializeCurrentFrame(); | 48 bool initializeCurrentFrame(); |
| 49 bool finalizeFrameInternal(); | 49 bool finalizeFrameInternal(); |
| 50 | 50 |
| 51 // saves current clip and transform matrix of canvas | 51 // saves current clip and transform matrix of canvas |
| 52 bool saveState(SkCanvas*, StateStack*); | 52 bool saveState(SkCanvas*, StateStack*); |
| 53 // we should make sure that we can transfer state in saveState | 53 // we should make sure that we can transfer state in saveState |
| 54 void setCurrentState(SkCanvas*, StateStack*); | 54 void setCurrentState(SkCanvas*, StateStack*); |
| 55 | 55 |
| 56 OwnPtr<SkPictureRecorder> m_currentFrame; | 56 OwnPtr<SkPictureRecorder> m_currentFrame; |
| 57 RefPtr<SkPicture> m_previousFrame; | 57 RefPtr<SkPicture> m_previousFrame; |
| 58 OwnPtr<SkCanvas> m_rasterCanvas; | 58 OwnPtr<SkCanvas> m_rasterCanvas; |
| 59 ImageBuffer* m_imageBuffer; | 59 ImageBuffer* m_imageBuffer; |
| 60 int m_initialSaveCount; | 60 int m_initialSaveCount; |
| 61 bool m_frameWasCleared; | 61 bool m_frameWasCleared; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace blink | 64 } // namespace blink |
| 65 | 65 |
| 66 #endif | 66 #endif |
| OLD | NEW |