| 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 pending_gpu_latency_query_ids_.push_back(gpu_latency_query_id); | 482 pending_gpu_latency_query_ids_.push_back(gpu_latency_query_id); |
| 483 } | 483 } |
| 484 | 484 |
| 485 void OutputSurface::PostSwapBuffersComplete() { | 485 void OutputSurface::PostSwapBuffersComplete() { |
| 486 base::MessageLoop::current()->PostTask( | 486 base::MessageLoop::current()->PostTask( |
| 487 FROM_HERE, | 487 FROM_HERE, |
| 488 base::Bind(&OutputSurface::OnSwapBuffersComplete, | 488 base::Bind(&OutputSurface::OnSwapBuffersComplete, |
| 489 weak_ptr_factory_.GetWeakPtr())); | 489 weak_ptr_factory_.GetWeakPtr())); |
| 490 } | 490 } |
| 491 | 491 |
| 492 void OutputSurface::SetMemoryPolicy(const ManagedMemoryPolicy& policy, | 492 void OutputSurface::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { |
| 493 bool discard_backbuffer) { | 493 TRACE_EVENT1("cc", "OutputSurface::SetMemoryPolicy", |
| 494 TRACE_EVENT2("cc", "OutputSurface::SetMemoryPolicy", | 494 "bytes_limit_when_visible", policy.bytes_limit_when_visible); |
| 495 "bytes_limit_when_visible", policy.bytes_limit_when_visible, | |
| 496 "discard_backbuffer", discard_backbuffer); | |
| 497 // Just ignore the memory manager when it says to set the limit to zero | 495 // Just ignore the memory manager when it says to set the limit to zero |
| 498 // bytes. This will happen when the memory manager thinks that the renderer | 496 // bytes. This will happen when the memory manager thinks that the renderer |
| 499 // is not visible (which the renderer knows better). | 497 // is not visible (which the renderer knows better). |
| 500 if (policy.bytes_limit_when_visible) | 498 if (policy.bytes_limit_when_visible) |
| 501 client_->SetMemoryPolicy(policy); | 499 client_->SetMemoryPolicy(policy); |
| 502 client_->SetDiscardBackBufferWhenNotVisible(discard_backbuffer); | |
| 503 } | 500 } |
| 504 | 501 |
| 505 } // namespace cc | 502 } // namespace cc |
| OLD | NEW |