Chromium Code Reviews| 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 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 982 // cause device_quad to become clipped. To our knowledge this scenario does | 982 // cause device_quad to become clipped. To our knowledge this scenario does |
| 983 // not need to be handled differently than the unclipped case. | 983 // not need to be handled differently than the unclipped case. |
| 984 return local_quad; | 984 return local_quad; |
| 985 } | 985 } |
| 986 | 986 |
| 987 const TileDrawQuad* GLRenderer::CanPassBeDrawnDirectly(const RenderPass* pass) { | 987 const TileDrawQuad* GLRenderer::CanPassBeDrawnDirectly(const RenderPass* pass) { |
| 988 // Can only collapse a single tile quad. | 988 // Can only collapse a single tile quad. |
| 989 if (pass->quad_list.size() != 1) | 989 if (pass->quad_list.size() != 1) |
| 990 return nullptr; | 990 return nullptr; |
| 991 // If we need copy requests, then render pass has to exist. | 991 // If we need copy requests, then render pass has to exist. |
| 992 if (!pass->copy_requests.empty()) | 992 if (!pass->copy_requests.empty() || pass->force_render_surface) |
|
reveman
2017/05/10 13:06:17
I'm not sure we want to avoid this optimization. I
wutao
2017/05/11 19:36:34
Agree. Removed.
| |
| 993 return nullptr; | 993 return nullptr; |
| 994 | 994 |
| 995 const DrawQuad* quad = *pass->quad_list.BackToFrontBegin(); | 995 const DrawQuad* quad = *pass->quad_list.BackToFrontBegin(); |
| 996 // Hack: this could be supported by concatenating transforms, but | 996 // Hack: this could be supported by concatenating transforms, but |
| 997 // in practice if there is one quad, it is at the origin of the render pass | 997 // in practice if there is one quad, it is at the origin of the render pass |
| 998 // and has the same size as the pass. | 998 // and has the same size as the pass. |
| 999 if (!quad->shared_quad_state->quad_to_target_transform.IsIdentity() || | 999 if (!quad->shared_quad_state->quad_to_target_transform.IsIdentity() || |
| 1000 quad->rect != pass->output_rect) | 1000 quad->rect != pass->output_rect) |
| 1001 return nullptr; | 1001 return nullptr; |
| 1002 // The quad is expected to be the entire layer so that AA edges are correct. | 1002 // The quad is expected to be the entire layer so that AA edges are correct. |
| (...skipping 2605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3608 return; | 3608 return; |
| 3609 | 3609 |
| 3610 // Report GPU overdraw as a percentage of |max_result|. | 3610 // Report GPU overdraw as a percentage of |max_result|. |
| 3611 TRACE_COUNTER1( | 3611 TRACE_COUNTER1( |
| 3612 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", | 3612 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", |
| 3613 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / | 3613 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / |
| 3614 max_result); | 3614 max_result); |
| 3615 } | 3615 } |
| 3616 | 3616 |
| 3617 } // namespace cc | 3617 } // namespace cc |
| OLD | NEW |