OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CC_SOFTWARE_OUTPUT_DEVICE_H_ | |
6 #define CC_SOFTWARE_OUTPUT_DEVICE_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "cc/base/cc_export.h" | |
10 #include "skia/ext/refptr.h" | |
11 #include "ui/gfx/rect.h" | |
12 #include "ui/gfx/size.h" | |
13 #include "ui/gfx/vector2d.h" | |
14 #include "ui/surface/transport_dib.h" | |
15 | |
16 class SkBitmap; | |
17 class SkDevice; | |
18 class SkCanvas; | |
19 | |
20 namespace cc { | |
21 | |
22 class SoftwareFrameData; | |
23 | |
24 // This is a "tear-off" class providing software drawing support to | |
25 // OutputSurface, such as to a platform-provided window framebuffer. | |
26 class CC_EXPORT SoftwareOutputDevice { | |
27 public: | |
28 | |
29 SoftwareOutputDevice(); | |
30 virtual ~SoftwareOutputDevice(); | |
31 | |
32 // SoftwareOutputDevice implementation | |
33 virtual void Resize(const gfx::Size& size); | |
34 | |
35 virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect); | |
36 virtual void EndPaint(SoftwareFrameData* frame_data=NULL); | |
37 | |
38 virtual void CopyToBitmap(const gfx::Rect& rect, SkBitmap* output); | |
39 virtual void Scroll(const gfx::Vector2d& delta, | |
40 const gfx::Rect& clip_rect); | |
41 | |
42 // TODO(skaslev) Remove this after UberCompositor lands. | |
43 virtual void ReclaimDIB(TransportDIB::Handle handle); | |
44 | |
45 protected: | |
46 gfx::Size viewport_size_; | |
47 gfx::Rect damage_rect_; | |
48 skia::RefPtr<SkDevice> device_; | |
49 skia::RefPtr<SkCanvas> canvas_; | |
50 | |
51 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDevice); | |
52 }; | |
53 | |
54 } // namespace cc | |
55 | |
56 #endif // CC_SOFTWARE_OUTPUT_DEVICE_H_ | |
OLD | NEW |