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

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

Issue 2825843002: Disable the direct-drawing optimization for quads with opacity. (Closed)
Patch Set: Created 3 years, 8 months 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 | « no previous file | third_party/WebKit/LayoutTests/compositing/opacity-with-mask.html » ('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 <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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/compositing/opacity-with-mask.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698