OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef RecordingImageBufferSurface_h | |
6 #define RecordingImageBufferSurface_h | |
7 | |
8 #include "platform/graphics/ImageBufferSurface.h" | |
9 #include "wtf/OwnPtr.h" | |
10 #include "wtf/RefPtr.h" | |
11 | |
12 class SkPicture; | |
13 class SkPictureRecorder; | |
14 | |
15 namespace WebCore { | |
16 | |
17 class GraphicsContext; | |
18 | |
19 class PLATFORM_EXPORT RecordingImageBufferSurface : public ImageBufferSurface { | |
20 WTF_MAKE_NONCOPYABLE(RecordingImageBufferSurface); WTF_MAKE_FAST_ALLOCATED; | |
21 public: | |
22 RecordingImageBufferSurface(const IntSize&, OpacityMode = NonOpaque); | |
23 virtual ~RecordingImageBufferSurface(); | |
24 | |
Sergey
2014/07/21 04:57:10
Could you please group and add a comment which of
Justin Novosad
2014/07/21 17:26:46
They all are, but yes good idea.
| |
25 virtual SkCanvas* canvas() const OVERRIDE; | |
26 virtual PassRefPtr<SkPicture> getPicture() OVERRIDE; | |
27 virtual bool isValid() const OVERRIDE { return true; } | |
28 virtual void willReadback() OVERRIDE; | |
29 virtual void didClearCanvas() OVERRIDE; | |
30 virtual void setImageBuffer(ImageBuffer*) OVERRIDE; | |
31 | |
32 private: | |
33 void fallBackToRasterCanvas(); | |
34 void initializeCurrentFrame(); | |
35 bool handleOpaqueFrame(); | |
36 | |
37 OwnPtr<SkPictureRecorder> m_currentFrame; | |
38 RefPtr<SkPicture> m_previousFrame; | |
39 OwnPtr<SkCanvas> m_rasterCanvas; | |
40 GraphicsContext* m_graphicsContext; | |
41 bool m_frameWasCleared; | |
42 }; | |
43 | |
44 } // namespace WebCore | |
45 | |
46 #endif | |
OLD | NEW |