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

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

Issue 202523002: cc: Replace Region with SimpleEnclosedRegion for occlusion tracking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simpleregion: . Created 6 years, 4 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 | Annotate | Revision Log
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 <vector> 7 #include <vector>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "cc/output/renderer.h" 10 #include "cc/output/renderer.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 visible_quad_rect, 173 visible_quad_rect,
174 id, 174 id,
175 premultiplied_alpha_, 175 premultiplied_alpha_,
176 uv_top_left_, 176 uv_top_left_,
177 uv_bottom_right_, 177 uv_bottom_right_,
178 bg_color, 178 bg_color,
179 vertex_opacity_, 179 vertex_opacity_,
180 flipped_); 180 flipped_);
181 } 181 }
182 182
183 Region TextureLayerImpl::VisibleContentOpaqueRegion() const { 183 SimpleEnclosedRegion TextureLayerImpl::VisibleContentOpaqueRegion() const {
184 if (contents_opaque()) 184 if (contents_opaque())
185 return visible_content_rect(); 185 return SimpleEnclosedRegion(visible_content_rect());
186 186
187 if (blend_background_color_ && (SkColorGetA(background_color()) == 0xFF)) 187 if (blend_background_color_ && (SkColorGetA(background_color()) == 0xFF))
188 return visible_content_rect(); 188 return SimpleEnclosedRegion(visible_content_rect());
189 189
190 return Region(); 190 return SimpleEnclosedRegion();
191 } 191 }
192 192
193 void TextureLayerImpl::ReleaseResources() { 193 void TextureLayerImpl::ReleaseResources() {
194 FreeTextureMailbox(); 194 FreeTextureMailbox();
195 texture_copy_.reset(); 195 texture_copy_.reset();
196 external_texture_resource_ = 0; 196 external_texture_resource_ = 0;
197 valid_texture_copy_ = false; 197 valid_texture_copy_ = false;
198 } 198 }
199 199
200 void TextureLayerImpl::SetPremultipliedAlpha(bool premultiplied_alpha) { 200 void TextureLayerImpl::SetPremultipliedAlpha(bool premultiplied_alpha) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 } else if (external_texture_resource_) { 247 } else if (external_texture_resource_) {
248 DCHECK(!own_mailbox_); 248 DCHECK(!own_mailbox_);
249 ResourceProvider* resource_provider = 249 ResourceProvider* resource_provider =
250 layer_tree_impl()->resource_provider(); 250 layer_tree_impl()->resource_provider();
251 resource_provider->DeleteResource(external_texture_resource_); 251 resource_provider->DeleteResource(external_texture_resource_);
252 external_texture_resource_ = 0; 252 external_texture_resource_ = 0;
253 } 253 }
254 } 254 }
255 255
256 } // namespace cc 256 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698