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" |
11 #include "third_party/skia/include/core/SkCanvas.h" | 11 #include "third_party/skia/include/core/SkCanvas.h" |
| 12 #include "wtf/Allocator.h" |
| 13 #include "wtf/Noncopyable.h" |
12 #include "wtf/OwnPtr.h" | 14 #include "wtf/OwnPtr.h" |
13 #include "wtf/RefPtr.h" | 15 #include "wtf/RefPtr.h" |
14 | 16 |
15 class SkPicture; | 17 class SkPicture; |
16 class SkPictureRecorder; | 18 class SkPictureRecorder; |
17 | 19 |
18 namespace blink { | 20 namespace blink { |
19 | 21 |
20 class ImageBuffer; | 22 class ImageBuffer; |
21 class RecordingImageBufferSurfaceTest; | 23 class RecordingImageBufferSurfaceTest; |
22 | 24 |
23 class RecordingImageBufferFallbackSurfaceFactory { | 25 class RecordingImageBufferFallbackSurfaceFactory { |
| 26 USING_FAST_MALLOC(RecordingImageBufferFallbackSurfaceFactory); |
| 27 WTF_MAKE_NONCOPYABLE(RecordingImageBufferFallbackSurfaceFactory); |
24 public: | 28 public: |
25 virtual PassOwnPtr<ImageBufferSurface> createSurface(const IntSize&, Opacity
Mode) = 0; | 29 virtual PassOwnPtr<ImageBufferSurface> createSurface(const IntSize&, Opacity
Mode) = 0; |
26 virtual ~RecordingImageBufferFallbackSurfaceFactory() { } | 30 virtual ~RecordingImageBufferFallbackSurfaceFactory() { } |
| 31 protected: |
| 32 RecordingImageBufferFallbackSurfaceFactory() { } |
27 }; | 33 }; |
28 | 34 |
29 class PLATFORM_EXPORT RecordingImageBufferSurface : public ImageBufferSurface { | 35 class PLATFORM_EXPORT RecordingImageBufferSurface : public ImageBufferSurface { |
30 WTF_MAKE_NONCOPYABLE(RecordingImageBufferSurface); USING_FAST_MALLOC(Recordi
ngImageBufferSurface); | 36 WTF_MAKE_NONCOPYABLE(RecordingImageBufferSurface); USING_FAST_MALLOC(Recordi
ngImageBufferSurface); |
31 public: | 37 public: |
32 RecordingImageBufferSurface(const IntSize&, PassOwnPtr<RecordingImageBufferF
allbackSurfaceFactory> fallbackFactory, OpacityMode = NonOpaque); | 38 RecordingImageBufferSurface(const IntSize&, PassOwnPtr<RecordingImageBufferF
allbackSurfaceFactory> fallbackFactory, OpacityMode = NonOpaque); |
33 ~RecordingImageBufferSurface() override; | 39 ~RecordingImageBufferSurface() override; |
34 | 40 |
35 // Implementation of ImageBufferSurface interfaces | 41 // Implementation of ImageBufferSurface interfaces |
36 SkCanvas* canvas() override; | 42 SkCanvas* canvas() override; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 bool m_frameWasCleared; | 78 bool m_frameWasCleared; |
73 bool m_didRecordDrawCommandsInCurrentFrame; | 79 bool m_didRecordDrawCommandsInCurrentFrame; |
74 bool m_currentFrameHasExpensiveOp; | 80 bool m_currentFrameHasExpensiveOp; |
75 bool m_previousFrameHasExpensiveOp; | 81 bool m_previousFrameHasExpensiveOp; |
76 OwnPtr<RecordingImageBufferFallbackSurfaceFactory> m_fallbackFactory; | 82 OwnPtr<RecordingImageBufferFallbackSurfaceFactory> m_fallbackFactory; |
77 }; | 83 }; |
78 | 84 |
79 } // namespace blink | 85 } // namespace blink |
80 | 86 |
81 #endif | 87 #endif |
OLD | NEW |