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

Side by Side Diff: cc/trees/occlusion_tracker.cc

Issue 23455060: mix-blend-mode implementation for accelerated layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unittests fixed Created 7 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 | « cc/trees/layer_tree_host_unittest_occlusion.cc ('k') | content/common/cc_messages.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/trees/occlusion_tracker.h" 5 #include "cc/trees/occlusion_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/debug/overdraw_metrics.h" 10 #include "cc/debug/overdraw_metrics.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 RenderSurfaceType* surface = finished_target->render_surface(); 218 RenderSurfaceType* surface = finished_target->render_surface();
219 219
220 // Readbacks always happen on render targets so we only need to check 220 // Readbacks always happen on render targets so we only need to check
221 // for readbacks here. 221 // for readbacks here.
222 bool target_is_only_for_copy_request = 222 bool target_is_only_for_copy_request =
223 finished_target->HasCopyRequest() && LayerIsHidden(finished_target); 223 finished_target->HasCopyRequest() && LayerIsHidden(finished_target);
224 224
225 // If the occlusion within the surface can not be applied to things outside of 225 // If the occlusion within the surface can not be applied to things outside of
226 // the surface's subtree, then clear the occlusion here so it won't be used. 226 // the surface's subtree, then clear the occlusion here so it won't be used.
227 if (finished_target->mask_layer() || 227 if (finished_target->mask_layer() || !SurfaceOpacityKnown(surface) ||
228 !SurfaceOpacityKnown(surface) ||
229 surface->draw_opacity() < 1 || 228 surface->draw_opacity() < 1 ||
229 !finished_target->uses_default_blend_mode() ||
230 target_is_only_for_copy_request || 230 target_is_only_for_copy_request ||
231 finished_target->filters().HasFilterThatAffectsOpacity()) { 231 finished_target->filters().HasFilterThatAffectsOpacity()) {
232 stack_.back().occlusion_from_outside_target.Clear(); 232 stack_.back().occlusion_from_outside_target.Clear();
233 stack_.back().occlusion_from_inside_target.Clear(); 233 stack_.back().occlusion_from_inside_target.Clear();
234 } else if (!SurfaceTransformsToTargetKnown(surface)) { 234 } else if (!SurfaceTransformsToTargetKnown(surface)) {
235 stack_.back().occlusion_from_inside_target.Clear(); 235 stack_.back().occlusion_from_inside_target.Clear();
236 stack_.back().occlusion_from_outside_target.Clear(); 236 stack_.back().occlusion_from_outside_target.Clear();
237 } 237 }
238 } 238 }
239 239
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 DCHECK_EQ(layer->render_target(), stack_.back().target); 398 DCHECK_EQ(layer->render_target(), stack_.back().target);
399 if (stack_.empty()) 399 if (stack_.empty())
400 return; 400 return;
401 401
402 if (!layer->DrawsContent()) 402 if (!layer->DrawsContent())
403 return; 403 return;
404 404
405 if (!LayerOpacityKnown(layer) || layer->draw_opacity() < 1) 405 if (!LayerOpacityKnown(layer) || layer->draw_opacity() < 1)
406 return; 406 return;
407 407
408 if (!layer->uses_default_blend_mode())
409 return;
410
408 if (LayerIsInUnsorted3dRenderingContext(layer)) 411 if (LayerIsInUnsorted3dRenderingContext(layer))
409 return; 412 return;
410 413
411 if (!LayerTransformsToTargetKnown(layer)) 414 if (!LayerTransformsToTargetKnown(layer))
412 return; 415 return;
413 416
414 Region opaque_contents = layer->VisibleContentOpaqueRegion(); 417 Region opaque_contents = layer->VisibleContentOpaqueRegion();
415 if (opaque_contents.IsEmpty()) 418 if (opaque_contents.IsEmpty())
416 return; 419 return;
417 420
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 unoccluded_rect.Intersect(content_rect); 663 unoccluded_rect.Intersect(content_rect);
661 664
662 return unoccluded_rect; 665 return unoccluded_rect;
663 } 666 }
664 667
665 // Instantiate (and export) templates here for the linker. 668 // Instantiate (and export) templates here for the linker.
666 template class OcclusionTrackerBase<Layer, RenderSurface>; 669 template class OcclusionTrackerBase<Layer, RenderSurface>;
667 template class OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>; 670 template class OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>;
668 671
669 } // namespace cc 672 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_occlusion.cc ('k') | content/common/cc_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698