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

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: Adding compositor pixel tests, clang-format Created 7 years, 2 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
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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 RenderSurfaceType* surface = finished_target->render_surface(); 227 RenderSurfaceType* surface = finished_target->render_surface();
228 228
229 // Readbacks always happen on render targets so we only need to check 229 // Readbacks always happen on render targets so we only need to check
230 // for readbacks here. 230 // for readbacks here.
231 bool target_is_only_for_copy_request = 231 bool target_is_only_for_copy_request =
232 finished_target->HasCopyRequest() && LayerIsHidden(finished_target); 232 finished_target->HasCopyRequest() && LayerIsHidden(finished_target);
233 233
234 // If the occlusion within the surface can not be applied to things outside of 234 // If the occlusion within the surface can not be applied to things outside of
235 // the surface's subtree, then clear the occlusion here so it won't be used. 235 // the surface's subtree, then clear the occlusion here so it won't be used.
236 if (finished_target->mask_layer() || 236 if (finished_target->mask_layer() || !SurfaceOpacityKnown(surface) ||
237 !SurfaceOpacityKnown(surface) ||
238 surface->draw_opacity() < 1 || 237 surface->draw_opacity() < 1 ||
238 !finished_target->uses_default_blend_mode() ||
239 target_is_only_for_copy_request || 239 target_is_only_for_copy_request ||
240 finished_target->filters().HasFilterThatAffectsOpacity()) { 240 finished_target->filters().HasFilterThatAffectsOpacity()) {
241 stack_.back().occlusion_from_outside_target.Clear(); 241 stack_.back().occlusion_from_outside_target.Clear();
242 stack_.back().occlusion_from_inside_target.Clear(); 242 stack_.back().occlusion_from_inside_target.Clear();
243 } else if (!SurfaceTransformsToTargetKnown(surface)) { 243 } else if (!SurfaceTransformsToTargetKnown(surface)) {
244 stack_.back().occlusion_from_inside_target.Clear(); 244 stack_.back().occlusion_from_inside_target.Clear();
245 stack_.back().occlusion_from_outside_target.Clear(); 245 stack_.back().occlusion_from_outside_target.Clear();
246 } 246 }
247 } 247 }
248 248
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 DCHECK_EQ(layer->render_target(), stack_.back().target); 413 DCHECK_EQ(layer->render_target(), stack_.back().target);
414 if (stack_.empty()) 414 if (stack_.empty())
415 return; 415 return;
416 416
417 if (!layer->DrawsContent()) 417 if (!layer->DrawsContent())
418 return; 418 return;
419 419
420 if (!LayerOpacityKnown(layer) || layer->draw_opacity() < 1) 420 if (!LayerOpacityKnown(layer) || layer->draw_opacity() < 1)
421 return; 421 return;
422 422
423 if (!layer->uses_default_blend_mode())
424 return;
425
423 if (LayerIsInUnsorted3dRenderingContext(layer)) 426 if (LayerIsInUnsorted3dRenderingContext(layer))
424 return; 427 return;
425 428
426 if (!LayerTransformsToTargetKnown(layer)) 429 if (!LayerTransformsToTargetKnown(layer))
427 return; 430 return;
428 431
429 Region opaque_contents = layer->VisibleContentOpaqueRegion(); 432 Region opaque_contents = layer->VisibleContentOpaqueRegion();
430 if (opaque_contents.IsEmpty()) 433 if (opaque_contents.IsEmpty())
431 return; 434 return;
432 435
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 unoccluded_rect.Intersect(content_rect); 687 unoccluded_rect.Intersect(content_rect);
685 688
686 return unoccluded_rect; 689 return unoccluded_rect;
687 } 690 }
688 691
689 // Instantiate (and export) templates here for the linker. 692 // Instantiate (and export) templates here for the linker.
690 template class OcclusionTrackerBase<Layer, RenderSurface>; 693 template class OcclusionTrackerBase<Layer, RenderSurface>;
691 template class OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>; 694 template class OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>;
692 695
693 } // namespace cc 696 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698