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

Side by Side Diff: cc/layers/texture_layer_impl.cc

Issue 1959893002: cc: Avoid appending invisible TextureLayer quads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/layers/texture_layer_impl.h" 5 #include "cc/layers/texture_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 bool opaque = contents_opaque() || (SkColorGetA(bg_color) == 0xFF); 158 bool opaque = contents_opaque() || (SkColorGetA(bg_color) == 0xFF);
159 159
160 gfx::Rect quad_rect(bounds()); 160 gfx::Rect quad_rect(bounds());
161 gfx::Rect opaque_rect = opaque ? quad_rect : gfx::Rect(); 161 gfx::Rect opaque_rect = opaque ? quad_rect : gfx::Rect();
162 gfx::Rect visible_quad_rect = 162 gfx::Rect visible_quad_rect =
163 draw_properties().occlusion_in_content_space.GetUnoccludedContentRect( 163 draw_properties().occlusion_in_content_space.GetUnoccludedContentRect(
164 quad_rect); 164 quad_rect);
165 if (visible_quad_rect.IsEmpty()) 165 if (visible_quad_rect.IsEmpty())
166 return; 166 return;
167 167
168 if (!vertex_opacity_[0] && !vertex_opacity_[1] && !vertex_opacity_[2] &&
169 !vertex_opacity_[3])
170 return;
171
168 if (!texture_mailbox_.secure_output_only() || 172 if (!texture_mailbox_.secure_output_only() ||
169 (layer_tree_impl()->OutputIsSecure() && !InsideCopyRequest())) { 173 (layer_tree_impl()->OutputIsSecure() && !InsideCopyRequest())) {
170 TextureDrawQuad* quad = 174 TextureDrawQuad* quad =
171 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); 175 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
172 ResourceId id = 176 ResourceId id =
173 valid_texture_copy_ ? texture_copy_->id() : external_texture_resource_; 177 valid_texture_copy_ ? texture_copy_->id() : external_texture_resource_;
174 quad->SetNew(shared_quad_state, quad_rect, opaque_rect, visible_quad_rect, 178 quad->SetNew(shared_quad_state, quad_rect, opaque_rect, visible_quad_rect,
175 id, premultiplied_alpha_, uv_top_left_, uv_bottom_right_, 179 id, premultiplied_alpha_, uv_top_left_, uv_bottom_right_,
176 bg_color, vertex_opacity_, flipped_, nearest_neighbor_); 180 bg_color, vertex_opacity_, flipped_, nearest_neighbor_);
177 if (!valid_texture_copy_) { 181 if (!valid_texture_copy_) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } else if (external_texture_resource_) { 266 } else if (external_texture_resource_) {
263 DCHECK(!own_mailbox_); 267 DCHECK(!own_mailbox_);
264 ResourceProvider* resource_provider = 268 ResourceProvider* resource_provider =
265 layer_tree_impl()->resource_provider(); 269 layer_tree_impl()->resource_provider();
266 resource_provider->DeleteResource(external_texture_resource_); 270 resource_provider->DeleteResource(external_texture_resource_);
267 external_texture_resource_ = 0; 271 external_texture_resource_ = 0;
268 } 272 }
269 } 273 }
270 274
271 } // namespace cc 275 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698