OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "content/browser/android/in_process/synchronous_compositor_output_surfa
ce.h" | 5 #include "content/browser/android/in_process/synchronous_compositor_output_surfa
ce.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "cc/output/begin_frame_args.h" | 9 #include "cc/output/begin_frame_args.h" |
10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 private: | 97 private: |
98 SynchronousCompositorOutputSurface* surface_; | 98 SynchronousCompositorOutputSurface* surface_; |
99 SkDevice null_device_; | 99 SkDevice null_device_; |
100 SkCanvas null_canvas_; | 100 SkCanvas null_canvas_; |
101 | 101 |
102 DISALLOW_COPY_AND_ASSIGN(SoftwareDevice); | 102 DISALLOW_COPY_AND_ASSIGN(SoftwareDevice); |
103 }; | 103 }; |
104 | 104 |
105 SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface( | 105 SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface( |
106 int routing_id) | 106 int routing_id, size_t max_transfer_buffer_usage_bytes) |
107 : cc::OutputSurface( | 107 : cc::OutputSurface( |
108 scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareDevice(this))), | 108 scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareDevice(this)), |
| 109 max_transfer_buffer_usage_bytes), |
109 routing_id_(routing_id), | 110 routing_id_(routing_id), |
110 needs_begin_frame_(false), | 111 needs_begin_frame_(false), |
111 invoking_composite_(false), | 112 invoking_composite_(false), |
112 did_swap_buffer_(false), | 113 did_swap_buffer_(false), |
113 current_sw_canvas_(NULL) { | 114 current_sw_canvas_(NULL) { |
114 capabilities_.deferred_gl_initialization = true; | 115 capabilities_.deferred_gl_initialization = true; |
115 capabilities_.draw_and_swap_full_viewport_every_frame = true; | 116 capabilities_.draw_and_swap_full_viewport_every_frame = true; |
116 capabilities_.adjust_deadline_for_parent = false; | 117 capabilities_.adjust_deadline_for_parent = false; |
117 // Cannot call out to GetDelegate() here as the output surface is not | 118 // Cannot call out to GetDelegate() here as the output surface is not |
118 // constructed on the correct thread. | 119 // constructed on the correct thread. |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 280 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
280 return BrowserThread::CurrentlyOn(BrowserThread::UI); | 281 return BrowserThread::CurrentlyOn(BrowserThread::UI); |
281 } | 282 } |
282 | 283 |
283 SynchronousCompositorOutputSurfaceDelegate* | 284 SynchronousCompositorOutputSurfaceDelegate* |
284 SynchronousCompositorOutputSurface::GetDelegate() { | 285 SynchronousCompositorOutputSurface::GetDelegate() { |
285 return SynchronousCompositorImpl::FromRoutingID(routing_id_); | 286 return SynchronousCompositorImpl::FromRoutingID(routing_id_); |
286 } | 287 } |
287 | 288 |
288 } // namespace content | 289 } // namespace content |
OLD | NEW |