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

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

Issue 2558393002: cc: Only use single quad pass optimization when quad rect matches pass rect (Closed)
Patch Set: Created 4 years 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 | cc/test/data/translated_blue_green_alpha_gl.png » ('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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 const TileDrawQuad* GLRenderer::CanPassBeDrawnDirectly(const RenderPass* pass) { 989 const TileDrawQuad* GLRenderer::CanPassBeDrawnDirectly(const RenderPass* pass) {
990 // Can only collapse a single tile quad. 990 // Can only collapse a single tile quad.
991 if (pass->quad_list.size() != 1) 991 if (pass->quad_list.size() != 1)
992 return nullptr; 992 return nullptr;
993 // If we need copy requests, then render pass has to exist. 993 // If we need copy requests, then render pass has to exist.
994 if (!pass->copy_requests.empty()) 994 if (!pass->copy_requests.empty())
995 return nullptr; 995 return nullptr;
996 996
997 const DrawQuad* quad = *pass->quad_list.BackToFrontBegin(); 997 const DrawQuad* quad = *pass->quad_list.BackToFrontBegin();
998 // Hack: this could be supported by concatenating transforms, but 998 // Hack: this could be supported by concatenating transforms, but
999 // in practice if there is one quad, it is at the origin of the render pass. 999 // in practice if there is one quad, it is at the origin of the render pass
1000 if (!quad->shared_quad_state->quad_to_target_transform.IsIdentity()) 1000 // and has the same size as the pass.
1001 if (!quad->shared_quad_state->quad_to_target_transform.IsIdentity() ||
1002 quad->rect != pass->output_rect)
1001 return nullptr; 1003 return nullptr;
1002 // The quad is expected to be the entire layer so that AA edges are correct. 1004 // 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) 1005 if (gfx::Rect(quad->shared_quad_state->quad_layer_bounds) != quad->rect)
1004 return nullptr; 1006 return nullptr;
1005 if (quad->material != DrawQuad::TILED_CONTENT) 1007 if (quad->material != DrawQuad::TILED_CONTENT)
1006 return nullptr; 1008 return nullptr;
1007 1009
1008 const TileDrawQuad* tile_quad = TileDrawQuad::MaterialCast(quad); 1010 const TileDrawQuad* tile_quad = TileDrawQuad::MaterialCast(quad);
1009 // Hack: this could be supported by passing in a subrectangle to draw 1011 // 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 1012 // render pass, although in practice if there is only one quad there
(...skipping 3030 matching lines...) Expand 10 before | Expand all | Expand 10 after
4041 // The alpha has already been applied when copying the RPDQ to an IOSurface. 4043 // The alpha has already been applied when copying the RPDQ to an IOSurface.
4042 GLfloat alpha = 1; 4044 GLfloat alpha = 1;
4043 gl_->ScheduleCALayerSharedStateCHROMIUM(alpha, is_clipped, clip_rect, 4045 gl_->ScheduleCALayerSharedStateCHROMIUM(alpha, is_clipped, clip_rect,
4044 sorting_context_id, gl_transform); 4046 sorting_context_id, gl_transform);
4045 gl_->ScheduleCALayerCHROMIUM( 4047 gl_->ScheduleCALayerCHROMIUM(
4046 texture_id, contents_rect, ca_layer_overlay->background_color, 4048 texture_id, contents_rect, ca_layer_overlay->background_color,
4047 ca_layer_overlay->edge_aa_mask, bounds_rect, filter); 4049 ca_layer_overlay->edge_aa_mask, bounds_rect, filter);
4048 } 4050 }
4049 4051
4050 } // namespace cc 4052 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/test/data/translated_blue_green_alpha_gl.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698