| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 | 419 |
| 420 bool GLRenderer::CanPartialSwap() { | 420 bool GLRenderer::CanPartialSwap() { |
| 421 if (use_swap_with_bounds_) | 421 if (use_swap_with_bounds_) |
| 422 return false; | 422 return false; |
| 423 auto* context_provider = output_surface_->context_provider(); | 423 auto* context_provider = output_surface_->context_provider(); |
| 424 return context_provider->ContextCapabilities().post_sub_buffer; | 424 return context_provider->ContextCapabilities().post_sub_buffer; |
| 425 } | 425 } |
| 426 | 426 |
| 427 ResourceFormat GLRenderer::BackbufferFormat() const { | 427 ResourceFormat GLRenderer::BackbufferFormat() const { |
| 428 if (current_frame()->current_render_pass->color_space.IsHDR() && | 428 if (current_frame()->current_render_pass->color_space.IsHDR() && |
| 429 resource_provider_->IsResourceFormatSupported(RGBA_F16)) { | 429 resource_provider_->IsRenderBufferFormatSupported(RGBA_F16)) { |
| 430 return RGBA_F16; | 430 return RGBA_F16; |
| 431 } | 431 } |
| 432 return resource_provider_->best_texture_format(); | 432 return resource_provider_->best_texture_format(); |
| 433 } | 433 } |
| 434 | 434 |
| 435 void GLRenderer::DidChangeVisibility() { | 435 void GLRenderer::DidChangeVisibility() { |
| 436 if (visible_) { | 436 if (visible_) { |
| 437 output_surface_->EnsureBackbuffer(); | 437 output_surface_->EnsureBackbuffer(); |
| 438 } else { | 438 } else { |
| 439 TRACE_EVENT0("cc", "GLRenderer::DidChangeVisibility dropping resources"); | 439 TRACE_EVENT0("cc", "GLRenderer::DidChangeVisibility dropping resources"); |
| (...skipping 3142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3582 return; | 3582 return; |
| 3583 | 3583 |
| 3584 // Report GPU overdraw as a percentage of |max_result|. | 3584 // Report GPU overdraw as a percentage of |max_result|. |
| 3585 TRACE_COUNTER1( | 3585 TRACE_COUNTER1( |
| 3586 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", | 3586 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", |
| 3587 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / | 3587 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / |
| 3588 max_result); | 3588 max_result); |
| 3589 } | 3589 } |
| 3590 | 3590 |
| 3591 } // namespace cc | 3591 } // namespace cc |
| OLD | NEW |