| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_H_ | 5 #ifndef CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_H_ |
| 6 #define CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_H_ | 6 #define CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| 11 #include "base/threading/non_thread_safe.h" | 11 #include "base/threading/non_thread_safe.h" |
| 12 #include "cc/output/software_output_device.h" | 12 #include "cc/output/software_output_device.h" |
| 13 #include "content/public/renderer/render_thread.h" | 13 #include "content/public/renderer/render_thread.h" |
| 14 #include "third_party/skia/include/core/SkBitmap.h" | 14 #include "third_party/skia/include/core/SkBitmap.h" |
| 15 | 15 |
| 16 class SkRegion; | 16 class SkRegion; |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 | 19 |
| 20 // This class can be created only on the main thread, but then becomes pinned | 20 // This class can be created only on the main thread, but then becomes pinned |
| 21 // to a fixed thread when BindToClient is called. | 21 // to a fixed thread when BindToClient is called. |
| 22 class CompositorSoftwareOutputDevice | 22 class CompositorSoftwareOutputDevice |
| 23 : NON_EXPORTED_BASE(public cc::SoftwareOutputDevice), | 23 : NON_EXPORTED_BASE(public cc::SoftwareOutputDevice), |
| 24 NON_EXPORTED_BASE(public base::NonThreadSafe) { | 24 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| 25 public: | 25 public: |
| 26 CompositorSoftwareOutputDevice(); | 26 CompositorSoftwareOutputDevice(); |
| 27 virtual ~CompositorSoftwareOutputDevice(); | 27 virtual ~CompositorSoftwareOutputDevice(); |
| 28 | 28 |
| 29 virtual void Resize(gfx::Size size) OVERRIDE; | 29 virtual void Resize(const gfx::Size& size) OVERRIDE; |
| 30 | 30 |
| 31 virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect) OVERRIDE; | 31 virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect) OVERRIDE; |
| 32 virtual void EndPaint(cc::SoftwareFrameData* frame_data) OVERRIDE; | 32 virtual void EndPaint(cc::SoftwareFrameData* frame_data) OVERRIDE; |
| 33 virtual void EnsureBackbuffer() OVERRIDE; | 33 virtual void EnsureBackbuffer() OVERRIDE; |
| 34 virtual void DiscardBackbuffer() OVERRIDE; | 34 virtual void DiscardBackbuffer() OVERRIDE; |
| 35 | 35 |
| 36 virtual void ReclaimSoftwareFrame(unsigned id) OVERRIDE; | 36 virtual void ReclaimSoftwareFrame(unsigned id) OVERRIDE; |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 // Internal buffer class that manages shared memory lifetime and ownership. | 39 // Internal buffer class that manages shared memory lifetime and ownership. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 unsigned next_buffer_id_; | 89 unsigned next_buffer_id_; |
| 90 ScopedVector<Buffer> buffers_; | 90 ScopedVector<Buffer> buffers_; |
| 91 ScopedVector<Buffer> awaiting_ack_; | 91 ScopedVector<Buffer> awaiting_ack_; |
| 92 SkBitmap bitmap_; | 92 SkBitmap bitmap_; |
| 93 RenderThread* render_thread_; | 93 RenderThread* render_thread_; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 } // namespace content | 96 } // namespace content |
| 97 | 97 |
| 98 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_H_ | 98 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_H_ |
| OLD | NEW |