| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 2649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2660 in_use_overlay_resources_.swap(pending_overlay_resources_); | 2660 in_use_overlay_resources_.swap(pending_overlay_resources_); |
| 2661 | 2661 |
| 2662 swap_buffer_rect_ = gfx::Rect(); | 2662 swap_buffer_rect_ = gfx::Rect(); |
| 2663 } | 2663 } |
| 2664 | 2664 |
| 2665 void GLRenderer::EnforceMemoryPolicy() { | 2665 void GLRenderer::EnforceMemoryPolicy() { |
| 2666 if (!visible()) { | 2666 if (!visible()) { |
| 2667 TRACE_EVENT0("cc", "GLRenderer::EnforceMemoryPolicy dropping resources"); | 2667 TRACE_EVENT0("cc", "GLRenderer::EnforceMemoryPolicy dropping resources"); |
| 2668 ReleaseRenderPassTextures(); | 2668 ReleaseRenderPassTextures(); |
| 2669 DiscardBackbuffer(); | 2669 DiscardBackbuffer(); |
| 2670 resource_provider_->ReleaseCachedData(); | |
| 2671 output_surface_->context_provider()->DeleteCachedResources(); | 2670 output_surface_->context_provider()->DeleteCachedResources(); |
| 2672 gl_->Flush(); | 2671 gl_->Flush(); |
| 2673 } | 2672 } |
| 2674 PrepareGeometry(NO_BINDING); | 2673 PrepareGeometry(NO_BINDING); |
| 2675 } | 2674 } |
| 2676 | 2675 |
| 2677 void GLRenderer::DiscardBackbuffer() { | 2676 void GLRenderer::DiscardBackbuffer() { |
| 2678 if (is_backbuffer_discarded_) | 2677 if (is_backbuffer_discarded_) |
| 2679 return; | 2678 return; |
| 2680 | 2679 |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3571 context_support_->ScheduleOverlayPlane( | 3570 context_support_->ScheduleOverlayPlane( |
| 3572 overlay.plane_z_order, | 3571 overlay.plane_z_order, |
| 3573 overlay.transform, | 3572 overlay.transform, |
| 3574 pending_overlay_resources_.back()->texture_id(), | 3573 pending_overlay_resources_.back()->texture_id(), |
| 3575 ToNearestRect(overlay.display_rect), | 3574 ToNearestRect(overlay.display_rect), |
| 3576 overlay.uv_rect); | 3575 overlay.uv_rect); |
| 3577 } | 3576 } |
| 3578 } | 3577 } |
| 3579 | 3578 |
| 3580 } // namespace cc | 3579 } // namespace cc |
| OLD | NEW |