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/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" |
9 #include "platform/graphics/ImageBufferSurface.h" | 9 #include "platform/graphics/ImageBufferSurface.h" |
10 #include "public/platform/WebThread.h" | 10 #include "public/platform/WebThread.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 }; | 28 }; |
29 | 29 |
30 class PLATFORM_EXPORT RecordingImageBufferSurface : public ImageBufferSurface { | 30 class PLATFORM_EXPORT RecordingImageBufferSurface : public ImageBufferSurface { |
31 WTF_MAKE_NONCOPYABLE(RecordingImageBufferSurface); WTF_MAKE_FAST_ALLOCATED(R
ecordingImageBufferSurface); | 31 WTF_MAKE_NONCOPYABLE(RecordingImageBufferSurface); WTF_MAKE_FAST_ALLOCATED(R
ecordingImageBufferSurface); |
32 public: | 32 public: |
33 RecordingImageBufferSurface(const IntSize&, PassOwnPtr<RecordingImageBufferF
allbackSurfaceFactory> fallbackFactory, OpacityMode = NonOpaque); | 33 RecordingImageBufferSurface(const IntSize&, PassOwnPtr<RecordingImageBufferF
allbackSurfaceFactory> fallbackFactory, OpacityMode = NonOpaque); |
34 ~RecordingImageBufferSurface() override; | 34 ~RecordingImageBufferSurface() override; |
35 | 35 |
36 // Implementation of ImageBufferSurface interfaces | 36 // Implementation of ImageBufferSurface interfaces |
37 SkCanvas* canvas() override; | 37 SkCanvas* canvas() override; |
38 SkCanvas* immediateCanvas() override; | 38 void disableDeferral() override; |
39 PassRefPtr<SkPicture> getPicture() override; | 39 PassRefPtr<SkPicture> getPicture() override; |
40 void flush() override; | 40 void flush() override; |
41 void didDraw(const FloatRect&) override; | 41 void didDraw(const FloatRect&) override; |
42 bool isValid() const override { return true; } | 42 bool isValid() const override { return true; } |
43 bool isRecording() const override { return !m_fallbackSurface; } | 43 bool isRecording() const override { return !m_fallbackSurface; } |
44 bool writePixels(const SkImageInfo& origInfo, const void* pixels, size_t row
Bytes, int x, int y) override; | 44 bool writePixels(const SkImageInfo& origInfo, const void* pixels, size_t row
Bytes, int x, int y) override; |
45 void willOverwriteCanvas() override; | 45 void willOverwriteCanvas() override; |
46 virtual void finalizeFrame(const FloatRect&); | 46 virtual void finalizeFrame(const FloatRect&); |
47 void setImageBuffer(ImageBuffer*) override; | 47 void setImageBuffer(ImageBuffer*) override; |
48 PassRefPtr<SkImage> newImageSnapshot() override; | 48 PassRefPtr<SkImage> newImageSnapshot() override; |
(...skipping 25 matching lines...) Expand all Loading... |
74 bool m_frameWasCleared; | 74 bool m_frameWasCleared; |
75 bool m_didRecordDrawCommandsInCurrentFrame; | 75 bool m_didRecordDrawCommandsInCurrentFrame; |
76 bool m_currentFrameHasExpensiveOp; | 76 bool m_currentFrameHasExpensiveOp; |
77 bool m_previousFrameHasExpensiveOp; | 77 bool m_previousFrameHasExpensiveOp; |
78 OwnPtr<RecordingImageBufferFallbackSurfaceFactory> m_fallbackFactory; | 78 OwnPtr<RecordingImageBufferFallbackSurfaceFactory> m_fallbackFactory; |
79 }; | 79 }; |
80 | 80 |
81 } // namespace blink | 81 } // namespace blink |
82 | 82 |
83 #endif | 83 #endif |
OLD | NEW |