| 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" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // FindDamageDifferenceFrom). | 42 // FindDamageDifferenceFrom). |
| 43 class Buffer { | 43 class Buffer { |
| 44 public: | 44 public: |
| 45 explicit Buffer(unsigned id, scoped_ptr<base::SharedMemory> mem); | 45 explicit Buffer(unsigned id, scoped_ptr<base::SharedMemory> mem); |
| 46 ~Buffer(); | 46 ~Buffer(); |
| 47 | 47 |
| 48 unsigned id() const { return id_; } | 48 unsigned id() const { return id_; } |
| 49 | 49 |
| 50 void* memory() const { return mem_->memory(); } | 50 void* memory() const { return mem_->memory(); } |
| 51 base::SharedMemoryHandle handle() const { return mem_->handle(); } | 51 base::SharedMemoryHandle handle() const { return mem_->handle(); } |
| 52 base::SharedMemory* shared_memory() const { return mem_.get(); } |
| 52 | 53 |
| 53 bool free() const { return free_; } | 54 bool free() const { return free_; } |
| 54 void SetFree(bool free) { free_ = free; } | 55 void SetFree(bool free) { free_ = free; } |
| 55 | 56 |
| 56 Buffer* parent() const { return parent_; } | 57 Buffer* parent() const { return parent_; } |
| 57 void SetParent(Buffer* parent, const gfx::Rect& damage); | 58 void SetParent(Buffer* parent, const gfx::Rect& damage); |
| 58 | 59 |
| 59 bool FindDamageDifferenceFrom(Buffer* buffer, SkRegion* result) const; | 60 bool FindDamageDifferenceFrom(Buffer* buffer, SkRegion* result) const; |
| 60 | 61 |
| 61 private: | 62 private: |
| (...skipping 26 matching lines...) Expand all Loading... |
| 88 unsigned next_buffer_id_; | 89 unsigned next_buffer_id_; |
| 89 ScopedVector<Buffer> buffers_; | 90 ScopedVector<Buffer> buffers_; |
| 90 ScopedVector<Buffer> awaiting_ack_; | 91 ScopedVector<Buffer> awaiting_ack_; |
| 91 SkBitmap bitmap_; | 92 SkBitmap bitmap_; |
| 92 RenderThread* render_thread_; | 93 RenderThread* render_thread_; |
| 93 }; | 94 }; |
| 94 | 95 |
| 95 } // namespace content | 96 } // namespace content |
| 96 | 97 |
| 97 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_H_ | 98 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_H_ |
| OLD | NEW |