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_OUTPUT_SOFTWARE_OUTPUT_DEVICE_H_ | 5 #ifndef CC_OUTPUT_SOFTWARE_OUTPUT_DEVICE_H_ |
6 #define CC_OUTPUT_SOFTWARE_OUTPUT_DEVICE_H_ | 6 #define CC_OUTPUT_SOFTWARE_OUTPUT_DEVICE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
10 #include "skia/ext/refptr.h" | 10 #include "skia/ext/refptr.h" |
11 // TODO(robertphillips): change this to "class SkBaseDevice;" | 11 // TODO(robertphillips): change this to "class SkBaseDevice;" |
12 #include "third_party/skia/include/core/SkDevice.h" | 12 #include "third_party/skia/include/core/SkDevice.h" |
13 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
14 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
15 #include "ui/gfx/vector2d.h" | 15 #include "ui/gfx/vector2d.h" |
16 | 16 |
17 class SkBitmap; | 17 class SkBitmap; |
18 class SkCanvas; | 18 class SkCanvas; |
19 | 19 |
| 20 namespace gfx { |
| 21 class VSyncProvider; |
| 22 } |
| 23 |
20 namespace cc { | 24 namespace cc { |
21 | 25 |
22 class SoftwareFrameData; | 26 class SoftwareFrameData; |
23 | 27 |
24 // This is a "tear-off" class providing software drawing support to | 28 // This is a "tear-off" class providing software drawing support to |
25 // OutputSurface, such as to a platform-provided window framebuffer. | 29 // OutputSurface, such as to a platform-provided window framebuffer. |
26 class CC_EXPORT SoftwareOutputDevice { | 30 class CC_EXPORT SoftwareOutputDevice { |
27 public: | 31 public: |
28 SoftwareOutputDevice(); | 32 SoftwareOutputDevice(); |
29 virtual ~SoftwareOutputDevice(); | 33 virtual ~SoftwareOutputDevice(); |
(...skipping 28 matching lines...) Expand all Loading... |
58 | 62 |
59 // Ensures that there is a backing buffer available on this instance. | 63 // Ensures that there is a backing buffer available on this instance. |
60 virtual void EnsureBackbuffer() {} | 64 virtual void EnsureBackbuffer() {} |
61 | 65 |
62 // TODO(skaslev) Remove this after UberCompositor lands. | 66 // TODO(skaslev) Remove this after UberCompositor lands. |
63 // Called in response to receiving a SwapBuffersAck. At this point, software | 67 // Called in response to receiving a SwapBuffersAck. At this point, software |
64 // frame identified by id can be reused or discarded as it is no longer being | 68 // frame identified by id can be reused or discarded as it is no longer being |
65 // displayed. | 69 // displayed. |
66 virtual void ReclaimSoftwareFrame(unsigned id); | 70 virtual void ReclaimSoftwareFrame(unsigned id); |
67 | 71 |
| 72 // VSyncProvider used to update the timer used to schedule draws with the |
| 73 // hardware vsync. Return NULL if a provider doesn't exist. |
| 74 virtual gfx::VSyncProvider* GetVSyncProvider(); |
| 75 |
68 protected: | 76 protected: |
69 gfx::Size viewport_size_; | 77 gfx::Size viewport_size_; |
70 gfx::Rect damage_rect_; | 78 gfx::Rect damage_rect_; |
71 skia::RefPtr<SkBaseDevice> device_; | 79 skia::RefPtr<SkBaseDevice> device_; |
72 skia::RefPtr<SkCanvas> canvas_; | 80 skia::RefPtr<SkCanvas> canvas_; |
73 | 81 |
74 private: | 82 private: |
75 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDevice); | 83 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDevice); |
76 }; | 84 }; |
77 | 85 |
78 } // namespace cc | 86 } // namespace cc |
79 | 87 |
80 #endif // CC_OUTPUT_SOFTWARE_OUTPUT_DEVICE_H_ | 88 #endif // CC_OUTPUT_SOFTWARE_OUTPUT_DEVICE_H_ |
OLD | NEW |