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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 << "\n\tcommand: " << command << ", error " | 380 << "\n\tcommand: " << command << ", error " |
381 << static_cast<int>(error) << "\n"; | 381 << static_cast<int>(error) << "\n"; |
382 } | 382 } |
383 | 383 |
384 void GLRenderer::DidChangeVisibility() { | 384 void GLRenderer::DidChangeVisibility() { |
385 EnforceMemoryPolicy(); | 385 EnforceMemoryPolicy(); |
386 | 386 |
387 context_support_->SetSurfaceVisible(visible()); | 387 context_support_->SetSurfaceVisible(visible()); |
388 } | 388 } |
389 | 389 |
390 void GLRenderer::SendManagedMemoryStats(size_t bytes_visible, | |
391 size_t bytes_visible_and_nearby, | |
392 size_t bytes_allocated) { | |
393 gpu::ManagedMemoryStats stats; | |
394 stats.bytes_required = bytes_visible; | |
395 stats.bytes_nice_to_have = bytes_visible_and_nearby; | |
396 stats.bytes_allocated = bytes_allocated; | |
397 stats.backbuffer_requested = !is_backbuffer_discarded_; | |
398 context_support_->SendManagedMemoryStats(stats); | |
399 } | |
400 | |
401 void GLRenderer::ReleaseRenderPassTextures() { render_pass_textures_.clear(); } | 390 void GLRenderer::ReleaseRenderPassTextures() { render_pass_textures_.clear(); } |
402 | 391 |
403 void GLRenderer::DiscardPixels(bool has_external_stencil_test, | 392 void GLRenderer::DiscardPixels(bool has_external_stencil_test, |
404 bool draw_rect_covers_full_surface) { | 393 bool draw_rect_covers_full_surface) { |
405 if (has_external_stencil_test || !draw_rect_covers_full_surface || | 394 if (has_external_stencil_test || !draw_rect_covers_full_surface || |
406 !capabilities_.using_discard_framebuffer) | 395 !capabilities_.using_discard_framebuffer) |
407 return; | 396 return; |
408 bool using_default_framebuffer = | 397 bool using_default_framebuffer = |
409 !current_framebuffer_lock_ && | 398 !current_framebuffer_lock_ && |
410 output_surface_->capabilities().uses_default_gl_framebuffer; | 399 output_surface_->capabilities().uses_default_gl_framebuffer; |
(...skipping 2780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3191 context_support_->ScheduleOverlayPlane( | 3180 context_support_->ScheduleOverlayPlane( |
3192 overlay.plane_z_order, | 3181 overlay.plane_z_order, |
3193 overlay.transform, | 3182 overlay.transform, |
3194 pending_overlay_resources_.back()->texture_id(), | 3183 pending_overlay_resources_.back()->texture_id(), |
3195 overlay.display_rect, | 3184 overlay.display_rect, |
3196 overlay.uv_rect); | 3185 overlay.uv_rect); |
3197 } | 3186 } |
3198 } | 3187 } |
3199 | 3188 |
3200 } // namespace cc | 3189 } // namespace cc |
OLD | NEW |