Chromium Code Reviews| Index: Source/platform/graphics/RecordingImageBufferSurface.h |
| diff --git a/Source/platform/graphics/RecordingImageBufferSurface.h b/Source/platform/graphics/RecordingImageBufferSurface.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0df0bf955c2fceee253600952c47fe22bede08f6 |
| --- /dev/null |
| +++ b/Source/platform/graphics/RecordingImageBufferSurface.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef RecordingImageBufferSurface_h |
| +#define RecordingImageBufferSurface_h |
| + |
| +#include "platform/graphics/ImageBufferSurface.h" |
| +#include "wtf/OwnPtr.h" |
| +#include "wtf/RefPtr.h" |
| + |
| +class SkPicture; |
| +class SkPictureRecorder; |
| + |
| +namespace WebCore { |
| + |
| +class GraphicsContext; |
| + |
| +class PLATFORM_EXPORT RecordingImageBufferSurface : public ImageBufferSurface { |
| + WTF_MAKE_NONCOPYABLE(RecordingImageBufferSurface); WTF_MAKE_FAST_ALLOCATED; |
| +public: |
| + RecordingImageBufferSurface(const IntSize&, OpacityMode = NonOpaque); |
| + virtual ~RecordingImageBufferSurface(); |
| + |
|
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.
|
| + virtual SkCanvas* canvas() const OVERRIDE; |
| + virtual PassRefPtr<SkPicture> getPicture() OVERRIDE; |
| + virtual bool isValid() const OVERRIDE { return true; } |
| + virtual void willReadback() OVERRIDE; |
| + virtual void didClearCanvas() OVERRIDE; |
| + virtual void setImageBuffer(ImageBuffer*) OVERRIDE; |
| + |
| +private: |
| + void fallBackToRasterCanvas(); |
| + void initializeCurrentFrame(); |
| + bool handleOpaqueFrame(); |
| + |
| + OwnPtr<SkPictureRecorder> m_currentFrame; |
| + RefPtr<SkPicture> m_previousFrame; |
| + OwnPtr<SkCanvas> m_rasterCanvas; |
| + GraphicsContext* m_graphicsContext; |
| + bool m_frameWasCleared; |
| +}; |
| + |
| +} // namespace WebCore |
| + |
| +#endif |