| 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 "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // This is a "tear-off" class providing software drawing support to | 29 // This is a "tear-off" class providing software drawing support to |
| 30 // OutputSurface, such as to a platform-provided window framebuffer. | 30 // OutputSurface, such as to a platform-provided window framebuffer. |
| 31 class CC_EXPORT SoftwareOutputDevice { | 31 class CC_EXPORT SoftwareOutputDevice { |
| 32 public: | 32 public: |
| 33 SoftwareOutputDevice(); | 33 SoftwareOutputDevice(); |
| 34 virtual ~SoftwareOutputDevice(); | 34 virtual ~SoftwareOutputDevice(); |
| 35 | 35 |
| 36 // Discards any pre-existing backing buffers and allocates memory for a | 36 // Discards any pre-existing backing buffers and allocates memory for a |
| 37 // software device of |size|. This must be called before the | 37 // software device of |size|. This must be called before the |
| 38 // |SoftwareOutputDevice| can be used in other ways. | 38 // |SoftwareOutputDevice| can be used in other ways. |
| 39 virtual void Resize(const gfx::Size& size); | 39 virtual void Resize(gfx::Size size); |
| 40 | 40 |
| 41 // Called on BeginDrawingFrame. The compositor will draw into the returned | 41 // Called on BeginDrawingFrame. The compositor will draw into the returned |
| 42 // SkCanvas. The |SoftwareOutputDevice| implementation needs to provide a | 42 // SkCanvas. The |SoftwareOutputDevice| implementation needs to provide a |
| 43 // valid SkCanvas of at least size |damage_rect|. This class retains ownership | 43 // valid SkCanvas of at least size |damage_rect|. This class retains ownership |
| 44 // of the SkCanvas. | 44 // of the SkCanvas. |
| 45 virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect); | 45 virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect); |
| 46 | 46 |
| 47 // Called on FinishDrawingFrame. The compositor will no longer mutate the the | 47 // Called on FinishDrawingFrame. The compositor will no longer mutate the the |
| 48 // SkCanvas instance returned by |BeginPaint| and should discard any reference | 48 // SkCanvas instance returned by |BeginPaint| and should discard any reference |
| 49 // that it holds to it. | 49 // that it holds to it. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 skia::RefPtr<SkCanvas> canvas_; | 81 skia::RefPtr<SkCanvas> canvas_; |
| 82 scoped_ptr<gfx::VSyncProvider> vsync_provider_; | 82 scoped_ptr<gfx::VSyncProvider> vsync_provider_; |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDevice); | 85 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDevice); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace cc | 88 } // namespace cc |
| 89 | 89 |
| 90 #endif // CC_OUTPUT_SOFTWARE_OUTPUT_DEVICE_H_ | 90 #endif // CC_OUTPUT_SOFTWARE_OUTPUT_DEVICE_H_ |
| OLD | NEW |