Chromium Code Reviews| 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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 335 context_provider_->ContextGL()->BeginQueryEXT(GL_LATENCY_QUERY_CHROMIUM, | 335 context_provider_->ContextGL()->BeginQueryEXT(GL_LATENCY_QUERY_CHROMIUM, |
| 336 gpu_latency_query_id); | 336 gpu_latency_query_id); |
| 337 context_provider_->ContextGL()->EndQueryEXT(GL_LATENCY_QUERY_CHROMIUM); | 337 context_provider_->ContextGL()->EndQueryEXT(GL_LATENCY_QUERY_CHROMIUM); |
| 338 pending_gpu_latency_query_ids_.push_back(gpu_latency_query_id); | 338 pending_gpu_latency_query_ids_.push_back(gpu_latency_query_id); |
| 339 #endif | 339 #endif |
| 340 } | 340 } |
| 341 | 341 |
| 342 void OutputSurface::PostSwapBuffersComplete() { | 342 void OutputSurface::PostSwapBuffersComplete() { |
| 343 base::MessageLoop::current()->PostTask( | 343 base::MessageLoop::current()->PostTask( |
| 344 FROM_HERE, | 344 FROM_HERE, |
| 345 base::Bind(&OutputSurface::OnSwapBuffersComplete, | 345 base::Bind(&OutputSurface::DoOnSwapBuffersComplete, |
|
danakj
2014/06/12 01:16:51
Does virtual method in a posttask not do what you'
ccameron
2014/06/12 01:28:25
I was under the impression that a virtual method s
| |
| 346 weak_ptr_factory_.GetWeakPtr())); | 346 weak_ptr_factory_.GetWeakPtr())); |
| 347 } | 347 } |
| 348 | 348 |
| 349 void OutputSurface::DoOnSwapBuffersComplete() { | |
| 350 OnSwapBuffersComplete(); | |
| 351 } | |
| 352 | |
| 349 // We don't post tasks bound to the client directly since they might run | 353 // We don't post tasks bound to the client directly since they might run |
| 350 // after the OutputSurface has been destroyed. | 354 // after the OutputSurface has been destroyed. |
| 351 void OutputSurface::OnSwapBuffersComplete() { | 355 void OutputSurface::OnSwapBuffersComplete() { |
| 352 client_->DidSwapBuffersComplete(); | 356 client_->DidSwapBuffersComplete(); |
| 353 } | 357 } |
| 354 | 358 |
| 355 void OutputSurface::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { | 359 void OutputSurface::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { |
| 356 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", | 360 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
| 357 "bytes_limit_when_visible", policy.bytes_limit_when_visible); | 361 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
| 358 // Just ignore the memory manager when it says to set the limit to zero | 362 // Just ignore the memory manager when it says to set the limit to zero |
| 359 // bytes. This will happen when the memory manager thinks that the renderer | 363 // bytes. This will happen when the memory manager thinks that the renderer |
| 360 // is not visible (which the renderer knows better). | 364 // is not visible (which the renderer knows better). |
| 361 if (policy.bytes_limit_when_visible) | 365 if (policy.bytes_limit_when_visible) |
| 362 client_->SetMemoryPolicy(policy); | 366 client_->SetMemoryPolicy(policy); |
| 363 } | 367 } |
| 364 | 368 |
| 365 } // namespace cc | 369 } // namespace cc |
| OLD | NEW |