Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(880)

Side by Side Diff: Source/platform/graphics/RecordingImageBufferSurface.h

Issue 379253002: Initial implementation of display list backed 2D canvases (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
25 // Implementation of ImageBufferSurface interfaces
26 virtual SkCanvas* canvas() const OVERRIDE;
27 virtual PassRefPtr<SkPicture> getPicture() OVERRIDE;
28 virtual bool isValid() const OVERRIDE { return true; }
29 virtual void willReadback() OVERRIDE;
30 virtual void didClearCanvas() OVERRIDE;
31 virtual void setImageBuffer(ImageBuffer*) OVERRIDE;
32
33 private:
34 void fallBackToRasterCanvas();
35 void initializeCurrentFrame();
36 bool handleOpaqueFrame();
37
38 OwnPtr<SkPictureRecorder> m_currentFrame;
39 RefPtr<SkPicture> m_previousFrame;
40 OwnPtr<SkCanvas> m_rasterCanvas;
41 GraphicsContext* m_graphicsContext;
42 bool m_frameWasCleared;
43 };
44
45 } // namespace WebCore
46
47 #endif
OLDNEW
« no previous file with comments | « Source/platform/graphics/ImageBufferSurface.cpp ('k') | Source/platform/graphics/RecordingImageBufferSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698