| 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 "wtf/OwnPtr.h" | 10 #include "wtf/OwnPtr.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class PLATFORM_EXPORT RecordingImageBufferSurface : public ImageBufferSurface { | 21 class PLATFORM_EXPORT RecordingImageBufferSurface : public ImageBufferSurface { |
| 22 WTF_MAKE_NONCOPYABLE(RecordingImageBufferSurface); WTF_MAKE_FAST_ALLOCATED; | 22 WTF_MAKE_NONCOPYABLE(RecordingImageBufferSurface); WTF_MAKE_FAST_ALLOCATED; |
| 23 public: | 23 public: |
| 24 RecordingImageBufferSurface(const IntSize&, OpacityMode = NonOpaque); | 24 RecordingImageBufferSurface(const IntSize&, OpacityMode = NonOpaque); |
| 25 virtual ~RecordingImageBufferSurface(); | 25 virtual ~RecordingImageBufferSurface(); |
| 26 | 26 |
| 27 // Implementation of ImageBufferSurface interfaces | 27 // Implementation of ImageBufferSurface interfaces |
| 28 virtual SkCanvas* canvas() const OVERRIDE; | 28 virtual SkCanvas* canvas() const OVERRIDE; |
| 29 virtual PassRefPtr<SkPicture> getPicture() OVERRIDE; | 29 virtual PassRefPtr<SkPicture> getPicture() OVERRIDE; |
| 30 virtual bool isValid() const OVERRIDE { return true; } | 30 virtual bool isValid() const OVERRIDE { return true; } |
| 31 virtual void willReadback() OVERRIDE; | 31 virtual void willAccessPixels() OVERRIDE; |
| 32 virtual void finalizeFrame() OVERRIDE; | 32 virtual void finalizeFrame() OVERRIDE; |
| 33 virtual void didClearCanvas() OVERRIDE; | 33 virtual void didClearCanvas() OVERRIDE; |
| 34 virtual void setImageBuffer(ImageBuffer*) OVERRIDE; | 34 virtual void setImageBuffer(ImageBuffer*) OVERRIDE; |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 friend class ::RecordingImageBufferSurfaceTest; // for unit testing | 37 friend class ::RecordingImageBufferSurfaceTest; // for unit testing |
| 38 void fallBackToRasterCanvas(); | 38 void fallBackToRasterCanvas(); |
| 39 void initializeCurrentFrame(); | 39 void initializeCurrentFrame(); |
| 40 bool finalizeFrameInternal(); | 40 bool finalizeFrameInternal(); |
| 41 | 41 |
| 42 OwnPtr<SkPictureRecorder> m_currentFrame; | 42 OwnPtr<SkPictureRecorder> m_currentFrame; |
| 43 RefPtr<SkPicture> m_previousFrame; | 43 RefPtr<SkPicture> m_previousFrame; |
| 44 OwnPtr<SkCanvas> m_rasterCanvas; | 44 OwnPtr<SkCanvas> m_rasterCanvas; |
| 45 ImageBuffer* m_imageBuffer; | 45 ImageBuffer* m_imageBuffer; |
| 46 int m_initialSaveCount; | 46 int m_initialSaveCount; |
| 47 bool m_frameWasCleared; | 47 bool m_frameWasCleared; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace blink | 50 } // namespace blink |
| 51 | 51 |
| 52 #endif | 52 #endif |
| OLD | NEW |