Chromium Code Reviews| Index: Source/platform/graphics/RecordingImageBufferSurface.h |
| diff --git a/Source/platform/graphics/UnacceleratedImageBufferSurface.h b/Source/platform/graphics/RecordingImageBufferSurface.h |
| similarity index 60% |
| copy from Source/platform/graphics/UnacceleratedImageBufferSurface.h |
| copy to Source/platform/graphics/RecordingImageBufferSurface.h |
| index 407cdcbf31149beae3708c49d2048b569b1d86b1..5a8046d8f1e51c43a38937425c7d1bf0921eb6cf 100644 |
| --- a/Source/platform/graphics/UnacceleratedImageBufferSurface.h |
| +++ b/Source/platform/graphics/RecordingImageBufferSurface.h |
| @@ -1,5 +1,5 @@ |
| /* |
| - * Copyright (c) 2013, Google Inc. All rights reserved. |
| + * Copyright (c) 2014, Google Inc. All rights reserved. |
| * |
| * Redistribution and use in source and binary forms, with or without |
| * modification, are permitted provided that the following conditions are |
| @@ -28,25 +28,41 @@ |
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| -#ifndef UnacceleratedImageBufferSurface_h |
| -#define UnacceleratedImageBufferSurface_h |
| +#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 PLATFORM_EXPORT UnacceleratedImageBufferSurface : public ImageBufferSurface { |
| - WTF_MAKE_NONCOPYABLE(UnacceleratedImageBufferSurface); WTF_MAKE_FAST_ALLOCATED; |
| +class PLATFORM_EXPORT RecordingImageBufferSurface : public ImageBufferSurface { |
| + WTF_MAKE_NONCOPYABLE(RecordingImageBufferSurface); WTF_MAKE_FAST_ALLOCATED; |
| public: |
| - UnacceleratedImageBufferSurface(const IntSize&, OpacityMode = NonOpaque); |
| - virtual ~UnacceleratedImageBufferSurface() { } |
| + RecordingImageBufferSurface(const IntSize&, OpacityMode = NonOpaque); |
| + virtual ~RecordingImageBufferSurface(); |
| - virtual SkCanvas* canvas() const OVERRIDE { return m_canvas.get(); } |
| - virtual bool isValid() const OVERRIDE { return m_canvas; } |
| + virtual SkCanvas* canvas() const OVERRIDE; |
| + virtual PassRefPtr<SkPicture> getPicture() OVERRIDE; |
| + virtual bool isValid() const OVERRIDE { return true; } |
|
dshwang
2014/07/14 11:45:40
AFAIK, chromium coding style prohibits virtual inl
Stephen White
2014/07/14 15:19:15
For now, we still use the Blink coding style guide
Justin Novosad
2014/07/17 18:34:14
There was a thread on blink-dev (or was it chromiu
|
| + virtual void willReadback() OVERRIDE; |
| + virtual void didClearCanvas() OVERRIDE; |
| + virtual void setImageBuffer(ImageBuffer*) OVERRIDE; |
| private: |
| - RefPtr<SkCanvas> m_canvas; |
| + void fallbackToRasterCanvas(); |
| + void initializeCurrentFrame(); |
| + bool handleOpaqueFrame(); |
| + |
| + OwnPtr<SkPictureRecorder> m_currentFrame; |
| + RefPtr<SkPicture> m_previousFrame; |
| + OwnPtr<SkCanvas> m_rasterCanvas; |
| + ImageBuffer* m_imageBuffer; |
| + bool m_frameWasCleared; |
| }; |
| } // namespace WebCore |