| 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 CleanupSharedObjects(); | 390 CleanupSharedObjects(); |
| 391 } | 391 } |
| 392 | 392 |
| 393 const RendererCapabilitiesImpl& GLRenderer::Capabilities() const { | 393 const RendererCapabilitiesImpl& GLRenderer::Capabilities() const { |
| 394 return capabilities_; | 394 return capabilities_; |
| 395 } | 395 } |
| 396 | 396 |
| 397 void GLRenderer::DidChangeVisibility() { | 397 void GLRenderer::DidChangeVisibility() { |
| 398 EnforceMemoryPolicy(); | 398 EnforceMemoryPolicy(); |
| 399 | 399 |
| 400 context_support_->SetSurfaceVisible(visible()); | |
| 401 | |
| 402 // If we are not visible, we ask the context to aggressively free resources. | 400 // If we are not visible, we ask the context to aggressively free resources. |
| 403 context_support_->SetAggressivelyFreeResources(!visible()); | 401 context_support_->SetAggressivelyFreeResources(!visible()); |
| 404 } | 402 } |
| 405 | 403 |
| 406 void GLRenderer::ReleaseRenderPassTextures() { render_pass_textures_.clear(); } | 404 void GLRenderer::ReleaseRenderPassTextures() { render_pass_textures_.clear(); } |
| 407 | 405 |
| 408 void GLRenderer::DiscardPixels() { | 406 void GLRenderer::DiscardPixels() { |
| 409 if (!capabilities_.using_discard_framebuffer) | 407 if (!capabilities_.using_discard_framebuffer) |
| 410 return; | 408 return; |
| 411 bool using_default_framebuffer = | 409 bool using_default_framebuffer = |
| (...skipping 3167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3579 texture_id = pending_overlay_resources_.back()->texture_id(); | 3577 texture_id = pending_overlay_resources_.back()->texture_id(); |
| 3580 } | 3578 } |
| 3581 | 3579 |
| 3582 context_support_->ScheduleOverlayPlane( | 3580 context_support_->ScheduleOverlayPlane( |
| 3583 overlay.plane_z_order, overlay.transform, texture_id, | 3581 overlay.plane_z_order, overlay.transform, texture_id, |
| 3584 ToNearestRect(overlay.display_rect), overlay.uv_rect); | 3582 ToNearestRect(overlay.display_rect), overlay.uv_rect); |
| 3585 } | 3583 } |
| 3586 } | 3584 } |
| 3587 | 3585 |
| 3588 } // namespace cc | 3586 } // namespace cc |
| OLD | NEW |