| 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 CleanupSharedObjects(); | 388 CleanupSharedObjects(); |
| 389 } | 389 } |
| 390 | 390 |
| 391 const RendererCapabilitiesImpl& GLRenderer::Capabilities() const { | 391 const RendererCapabilitiesImpl& GLRenderer::Capabilities() const { |
| 392 return capabilities_; | 392 return capabilities_; |
| 393 } | 393 } |
| 394 | 394 |
| 395 void GLRenderer::DidChangeVisibility() { | 395 void GLRenderer::DidChangeVisibility() { |
| 396 EnforceMemoryPolicy(); | 396 EnforceMemoryPolicy(); |
| 397 | 397 |
| 398 context_support_->SetSurfaceVisible(visible()); | |
| 399 | |
| 400 // If we are not visible, we ask the context to aggressively free resources. | 398 // If we are not visible, we ask the context to aggressively free resources. |
| 401 context_support_->SetAggressivelyFreeResources(!visible()); | 399 context_support_->SetAggressivelyFreeResources(!visible()); |
| 402 } | 400 } |
| 403 | 401 |
| 404 void GLRenderer::ReleaseRenderPassTextures() { render_pass_textures_.clear(); } | 402 void GLRenderer::ReleaseRenderPassTextures() { render_pass_textures_.clear(); } |
| 405 | 403 |
| 406 void GLRenderer::DiscardPixels() { | 404 void GLRenderer::DiscardPixels() { |
| 407 if (!capabilities_.using_discard_framebuffer) | 405 if (!capabilities_.using_discard_framebuffer) |
| 408 return; | 406 return; |
| 409 bool using_default_framebuffer = | 407 bool using_default_framebuffer = |
| (...skipping 3134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3544 texture_id = pending_overlay_resources_.back()->texture_id(); | 3542 texture_id = pending_overlay_resources_.back()->texture_id(); |
| 3545 } | 3543 } |
| 3546 | 3544 |
| 3547 context_support_->ScheduleOverlayPlane( | 3545 context_support_->ScheduleOverlayPlane( |
| 3548 overlay.plane_z_order, overlay.transform, texture_id, | 3546 overlay.plane_z_order, overlay.transform, texture_id, |
| 3549 ToNearestRect(overlay.display_rect), overlay.uv_rect); | 3547 ToNearestRect(overlay.display_rect), overlay.uv_rect); |
| 3550 } | 3548 } |
| 3551 } | 3549 } |
| 3552 | 3550 |
| 3553 } // namespace cc | 3551 } // namespace cc |
| OLD | NEW |