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

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

Issue 2821903004: 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 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.
1003 if (gfx::Rect(quad->shared_quad_state->quad_layer_bounds) != quad->rect) 1003 if (gfx::Rect(quad->shared_quad_state->quad_layer_bounds) != quad->rect)
1004 return nullptr; 1004 return nullptr;
1005 if (quad->material != DrawQuad::TILED_CONTENT) 1005 if (quad->material != DrawQuad::TILED_CONTENT)
1006 return nullptr; 1006 return nullptr;
1007 1007
1008 // TODO(chrishtr): support could be added for opacity, but care needs
1009 // to be taken to make sure it is correct w.r.t. non-commutative filters etc.
1010 if (quad->shared_quad_state->opacity != 1.0f)
1011 return nullptr;
1012
1008 const TileDrawQuad* tile_quad = TileDrawQuad::MaterialCast(quad); 1013 const TileDrawQuad* tile_quad = TileDrawQuad::MaterialCast(quad);
1009 // Hack: this could be supported by passing in a subrectangle to draw 1014 // Hack: this could be supported by passing in a subrectangle to draw
1010 // render pass, although in practice if there is only one quad there 1015 // render pass, although in practice if there is only one quad there
1011 // will be no border texels on the input. 1016 // will be no border texels on the input.
1012 if (tile_quad->tex_coord_rect != gfx::RectF(tile_quad->rect)) 1017 if (tile_quad->tex_coord_rect != gfx::RectF(tile_quad->rect))
1013 return nullptr; 1018 return nullptr;
1014 // Tile quad features not supported in render pass shaders. 1019 // Tile quad features not supported in render pass shaders.
1015 if (tile_quad->swizzle_contents || tile_quad->nearest_neighbor) 1020 if (tile_quad->swizzle_contents || tile_quad->nearest_neighbor)
1016 return nullptr; 1021 return nullptr;
1017 // BUG=skia:3868, Skia currently doesn't support texture rectangle inputs. 1022 // BUG=skia:3868, Skia currently doesn't support texture rectangle inputs.
(...skipping 2578 matching lines...) Expand 10 before | Expand all | Expand 10 after
3596 return; 3601 return;
3597 3602
3598 // Report GPU overdraw as a percentage of |max_result|. 3603 // Report GPU overdraw as a percentage of |max_result|.
3599 TRACE_COUNTER1( 3604 TRACE_COUNTER1(
3600 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", 3605 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw",
3601 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / 3606 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) /
3602 max_result); 3607 max_result);
3603 } 3608 }
3604 3609
3605 } // namespace cc 3610 } // 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