OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_H_ |
| 6 #define CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_H_ |
| 7 |
| 8 #include "base/memory/scoped_vector.h" |
| 9 #include "base/threading/non_thread_safe.h" |
| 10 #include "cc/output/software_output_device.h" |
| 11 #include "third_party/skia/include/core/SkBitmap.h" |
| 12 #include "ui/surface/transport_dib.h" |
| 13 |
| 14 namespace content { |
| 15 |
| 16 // This class can be created only on the main thread, but then becomes pinned |
| 17 // to a fixed thread when BindToClient is called. |
| 18 class CompositorSoftwareOutputDevice |
| 19 : NON_EXPORTED_BASE(public cc::SoftwareOutputDevice), |
| 20 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| 21 public: |
| 22 CompositorSoftwareOutputDevice(); |
| 23 virtual ~CompositorSoftwareOutputDevice(); |
| 24 |
| 25 virtual void Resize(gfx::Size size) OVERRIDE; |
| 26 |
| 27 virtual SkCanvas* BeginPaint(gfx::Rect damage_rect) OVERRIDE; |
| 28 virtual void EndPaint(cc::SoftwareFrameData* frame_data) OVERRIDE; |
| 29 |
| 30 virtual void ReclaimDIB(const TransportDIB::Id& id) OVERRIDE; |
| 31 |
| 32 private: |
| 33 TransportDIB* CreateDIB(); |
| 34 |
| 35 int front_buffer_; |
| 36 int last_buffer_; |
| 37 int num_free_buffers_; |
| 38 ScopedVector<TransportDIB> dibs_; |
| 39 ScopedVector<TransportDIB> awaiting_ack_; |
| 40 SkBitmap bitmap_; |
| 41 uint32 sequence_num_; |
| 42 }; |
| 43 |
| 44 } // namespace content |
| 45 |
| 46 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_SOFTWARE_OUTPUT_DEVICE_H_ |
OLD | NEW |