Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1072)

Side by Side Diff: cc/output/gl_renderer.cc

Issue 1469863003: Cleanup SurfaceVisibility code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase.. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/output/delegating_renderer.cc ('k') | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/output/delegating_renderer.cc ('k') | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698