| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 CC_SOFTWARE_OUTPUT_DEVICE_H_ | 5 #ifndef CC_SOFTWARE_OUTPUT_DEVICE_H_ |
| 6 #define CC_SOFTWARE_OUTPUT_DEVICE_H_ | 6 #define CC_SOFTWARE_OUTPUT_DEVICE_H_ |
| 7 | 7 |
| 8 #include "third_party/WebKit/Source/Platform/chromium/public/WebImage.h" | 8 #include "cc/cc_export.h" |
| 9 #include "ui/gfx/rect.h" |
| 9 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| 11 #include "ui/gfx/vector2d.h" |
| 12 |
| 13 class SkBitmap; |
| 14 class SkCanvas; |
| 10 | 15 |
| 11 namespace cc { | 16 namespace cc { |
| 12 | 17 |
| 13 // This is a "tear-off" class providing software drawing support to | 18 // This is a "tear-off" class providing software drawing support to |
| 14 // OutputSurface, such as to a platform-provided window framebuffer. | 19 // OutputSurface, such as to a platform-provided window framebuffer. |
| 15 class SoftwareOutputDevice { | 20 class CC_EXPORT SoftwareOutputDevice { |
| 16 public: | 21 public: |
| 17 virtual ~SoftwareOutputDevice() {} | 22 virtual ~SoftwareOutputDevice() {} |
| 18 | 23 |
| 19 // Lock the framebuffer and return a pointer to a WebImage referring to its | 24 virtual void Resize(const gfx::Size& size) = 0; |
| 20 // pixels. Set forWrite if you intend to change the pixels. Readback | |
| 21 // is supported whether or not forWrite is set. | |
| 22 // TODO(danakj): Switch this from WebImage to a Skia type. | |
| 23 virtual WebKit::WebImage* Lock(bool forWrite) = 0; | |
| 24 virtual void Unlock() = 0; | |
| 25 | 25 |
| 26 virtual void DidChangeViewportSize(gfx::Size) = 0; | 26 virtual SkCanvas* BeginPaint() = 0; |
| 27 virtual void EndPaint(const gfx::Rect& damage_rect) = 0; |
| 28 |
| 29 virtual void CopyToBitmap(const gfx::Rect& rect, SkBitmap* output) = 0; |
| 30 |
| 31 virtual void Scroll(const gfx::Vector2d& delta, |
| 32 const gfx::Rect& clip_rect) = 0; |
| 27 }; | 33 }; |
| 28 | 34 |
| 29 } // namespace cc | 35 } // namespace cc |
| 30 | 36 |
| 31 #endif // CC_SOFTWARE_OUTPUT_DEVICE_H_ | 37 #endif // CC_SOFTWARE_OUTPUT_DEVICE_H_ |
| OLD | NEW |