| 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 #include "cc/output/output_surface.h" | 5 #include "cc/output/output_surface.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 void OutputSurface::FrameRateControllerTick(bool throttled, | 129 void OutputSurface::FrameRateControllerTick(bool throttled, |
| 130 const BeginFrameArgs& args) { | 130 const BeginFrameArgs& args) { |
| 131 DCHECK(frame_rate_controller_); | 131 DCHECK(frame_rate_controller_); |
| 132 if (throttled) | 132 if (throttled) |
| 133 skipped_begin_impl_frame_args_ = args; | 133 skipped_begin_impl_frame_args_ = args; |
| 134 else | 134 else |
| 135 BeginImplFrame(args); | 135 BeginImplFrame(args); |
| 136 } | 136 } |
| 137 | 137 |
| 138 // Forwarded to OutputSurfaceClient | 138 // Forwarded to OutputSurfaceClient |
| 139 void OutputSurface::SetNeedsRedrawRect(gfx::Rect damage_rect) { | 139 void OutputSurface::SetNeedsRedrawRect(const gfx::Rect& damage_rect) { |
| 140 TRACE_EVENT0("cc", "OutputSurface::SetNeedsRedrawRect"); | 140 TRACE_EVENT0("cc", "OutputSurface::SetNeedsRedrawRect"); |
| 141 client_->SetNeedsRedrawRect(damage_rect); | 141 client_->SetNeedsRedrawRect(damage_rect); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void OutputSurface::SetNeedsBeginImplFrame(bool enable) { | 144 void OutputSurface::SetNeedsBeginImplFrame(bool enable) { |
| 145 TRACE_EVENT1("cc", "OutputSurface::SetNeedsBeginImplFrame", "enable", enable); | 145 TRACE_EVENT1("cc", "OutputSurface::SetNeedsBeginImplFrame", "enable", enable); |
| 146 needs_begin_impl_frame_ = enable; | 146 needs_begin_impl_frame_ = enable; |
| 147 client_ready_for_begin_impl_frame_ = true; | 147 client_ready_for_begin_impl_frame_ = true; |
| 148 if (frame_rate_controller_) { | 148 if (frame_rate_controller_) { |
| 149 BeginFrameArgs skipped = frame_rate_controller_->SetActive(enable); | 149 BeginFrameArgs skipped = frame_rate_controller_->SetActive(enable); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 pending_gpu_latency_query_ids_.clear(); | 235 pending_gpu_latency_query_ids_.clear(); |
| 236 available_gpu_latency_query_ids_.clear(); | 236 available_gpu_latency_query_ids_.clear(); |
| 237 client_->DidLoseOutputSurface(); | 237 client_->DidLoseOutputSurface(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void OutputSurface::SetExternalStencilTest(bool enabled) { | 240 void OutputSurface::SetExternalStencilTest(bool enabled) { |
| 241 external_stencil_test_enabled_ = enabled; | 241 external_stencil_test_enabled_ = enabled; |
| 242 } | 242 } |
| 243 | 243 |
| 244 void OutputSurface::SetExternalDrawConstraints(const gfx::Transform& transform, | 244 void OutputSurface::SetExternalDrawConstraints(const gfx::Transform& transform, |
| 245 gfx::Rect viewport, | 245 const gfx::Rect& viewport, |
| 246 gfx::Rect clip, | 246 const gfx::Rect& clip, |
| 247 bool valid_for_tile_management) { | 247 bool valid_for_tile_management) { |
| 248 client_->SetExternalDrawConstraints( | 248 client_->SetExternalDrawConstraints( |
| 249 transform, viewport, clip, valid_for_tile_management); | 249 transform, viewport, clip, valid_for_tile_management); |
| 250 } | 250 } |
| 251 | 251 |
| 252 OutputSurface::~OutputSurface() { | 252 OutputSurface::~OutputSurface() { |
| 253 if (frame_rate_controller_) | 253 if (frame_rate_controller_) |
| 254 frame_rate_controller_->SetActive(false); | 254 frame_rate_controller_->SetActive(false); |
| 255 ResetContext3d(); | 255 ResetContext3d(); |
| 256 } | 256 } |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", | 483 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
| 484 "bytes_limit_when_visible", policy.bytes_limit_when_visible); | 484 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
| 485 // Just ignore the memory manager when it says to set the limit to zero | 485 // Just ignore the memory manager when it says to set the limit to zero |
| 486 // bytes. This will happen when the memory manager thinks that the renderer | 486 // bytes. This will happen when the memory manager thinks that the renderer |
| 487 // is not visible (which the renderer knows better). | 487 // is not visible (which the renderer knows better). |
| 488 if (policy.bytes_limit_when_visible) | 488 if (policy.bytes_limit_when_visible) |
| 489 client_->SetMemoryPolicy(policy); | 489 client_->SetMemoryPolicy(policy); |
| 490 } | 490 } |
| 491 | 491 |
| 492 } // namespace cc | 492 } // namespace cc |
| OLD | NEW |