| 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 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 // and has the same size as the pass. | 994 // and has the same size as the pass. |
| 995 if (!quad->shared_quad_state->quad_to_target_transform.IsIdentity() || | 995 if (!quad->shared_quad_state->quad_to_target_transform.IsIdentity() || |
| 996 quad->rect != pass->output_rect) | 996 quad->rect != pass->output_rect) |
| 997 return nullptr; | 997 return nullptr; |
| 998 // The quad is expected to be the entire layer so that AA edges are correct. | 998 // The quad is expected to be the entire layer so that AA edges are correct. |
| 999 if (gfx::Rect(quad->shared_quad_state->quad_layer_bounds) != quad->rect) | 999 if (gfx::Rect(quad->shared_quad_state->quad_layer_bounds) != quad->rect) |
| 1000 return nullptr; | 1000 return nullptr; |
| 1001 if (quad->material != DrawQuad::TILED_CONTENT) | 1001 if (quad->material != DrawQuad::TILED_CONTENT) |
| 1002 return nullptr; | 1002 return nullptr; |
| 1003 | 1003 |
| 1004 // TODO(chrishtr): support could be added for opacity, but care needs |
| 1005 // to be taken to make sure it is correct w.r.t. non-commutative filters etc. |
| 1006 if (quad->shared_quad_state->opacity != 1.0f) |
| 1007 return nullptr; |
| 1008 |
| 1004 const TileDrawQuad* tile_quad = TileDrawQuad::MaterialCast(quad); | 1009 const TileDrawQuad* tile_quad = TileDrawQuad::MaterialCast(quad); |
| 1005 // Hack: this could be supported by passing in a subrectangle to draw | 1010 // Hack: this could be supported by passing in a subrectangle to draw |
| 1006 // render pass, although in practice if there is only one quad there | 1011 // render pass, although in practice if there is only one quad there |
| 1007 // will be no border texels on the input. | 1012 // will be no border texels on the input. |
| 1008 if (tile_quad->tex_coord_rect != gfx::RectF(tile_quad->rect)) | 1013 if (tile_quad->tex_coord_rect != gfx::RectF(tile_quad->rect)) |
| 1009 return nullptr; | 1014 return nullptr; |
| 1010 // Tile quad features not supported in render pass shaders. | 1015 // Tile quad features not supported in render pass shaders. |
| 1011 if (tile_quad->swizzle_contents || tile_quad->nearest_neighbor) | 1016 if (tile_quad->swizzle_contents || tile_quad->nearest_neighbor) |
| 1012 return nullptr; | 1017 return nullptr; |
| 1013 // BUG=skia:3868, Skia currently doesn't support texture rectangle inputs. | 1018 // BUG=skia:3868, Skia currently doesn't support texture rectangle inputs. |
| (...skipping 2492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3506 return; | 3511 return; |
| 3507 | 3512 |
| 3508 // Report GPU overdraw as a percentage of |max_result|. | 3513 // Report GPU overdraw as a percentage of |max_result|. |
| 3509 TRACE_COUNTER1( | 3514 TRACE_COUNTER1( |
| 3510 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", | 3515 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", |
| 3511 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / | 3516 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / |
| 3512 max_result); | 3517 max_result); |
| 3513 } | 3518 } |
| 3514 | 3519 |
| 3515 } // namespace cc | 3520 } // namespace cc |
| OLD | NEW |