| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 invoking_composite_(false), | 108 invoking_composite_(false), |
| 109 did_swap_buffer_(false), | 109 did_swap_buffer_(false), |
| 110 current_sw_canvas_(NULL), | 110 current_sw_canvas_(NULL), |
| 111 memory_policy_(0), | 111 memory_policy_(0), |
| 112 output_surface_client_(NULL) { | 112 output_surface_client_(NULL) { |
| 113 capabilities_.deferred_gl_initialization = true; | 113 capabilities_.deferred_gl_initialization = true; |
| 114 capabilities_.draw_and_swap_full_viewport_every_frame = true; | 114 capabilities_.draw_and_swap_full_viewport_every_frame = true; |
| 115 capabilities_.adjust_deadline_for_parent = false; | 115 capabilities_.adjust_deadline_for_parent = false; |
| 116 // Cannot call out to GetDelegate() here as the output surface is not | 116 // Cannot call out to GetDelegate() here as the output surface is not |
| 117 // constructed on the correct thread. | 117 // constructed on the correct thread. |
| 118 |
| 119 memory_policy_.priority_cutoff_when_visible = |
| 120 cc::ManagedMemoryPolicy::CUTOFF_ALLOW_NICE_TO_HAVE; |
| 118 } | 121 } |
| 119 | 122 |
| 120 SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() { | 123 SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() { |
| 121 DCHECK(CalledOnValidThread()); | 124 DCHECK(CalledOnValidThread()); |
| 122 SynchronousCompositorOutputSurfaceDelegate* delegate = GetDelegate(); | 125 SynchronousCompositorOutputSurfaceDelegate* delegate = GetDelegate(); |
| 123 if (delegate) | 126 if (delegate) |
| 124 delegate->DidDestroySynchronousOutputSurface(this); | 127 delegate->DidDestroySynchronousOutputSurface(this); |
| 125 } | 128 } |
| 126 | 129 |
| 127 bool SynchronousCompositorOutputSurface::ForcedDrawToSoftwareDevice() const { | 130 bool SynchronousCompositorOutputSurface::ForcedDrawToSoftwareDevice() const { |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { | 304 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { |
| 302 return BrowserThread::CurrentlyOn(BrowserThread::UI); | 305 return BrowserThread::CurrentlyOn(BrowserThread::UI); |
| 303 } | 306 } |
| 304 | 307 |
| 305 SynchronousCompositorOutputSurfaceDelegate* | 308 SynchronousCompositorOutputSurfaceDelegate* |
| 306 SynchronousCompositorOutputSurface::GetDelegate() { | 309 SynchronousCompositorOutputSurface::GetDelegate() { |
| 307 return SynchronousCompositorImpl::FromRoutingID(routing_id_); | 310 return SynchronousCompositorImpl::FromRoutingID(routing_id_); |
| 308 } | 311 } |
| 309 | 312 |
| 310 } // namespace content | 313 } // namespace content |
| OLD | NEW |