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

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 11871008: cc: Stop using drawableContentRect for occlusion. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
« no previous file with comments | « cc/layer_impl.cc ('k') | cc/layer_tree_host_impl_unittest.cc » ('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 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/layer_tree_host_impl.h" 5 #include "cc/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // Manually create the quad state for the gutter quads, as the root layer 411 // Manually create the quad state for the gutter quads, as the root layer
412 // doesn't have any bounds and so can't generate this itself. 412 // doesn't have any bounds and so can't generate this itself.
413 // FIXME: Make the gutter quads generated by the solid color layer (make it smarter about generating quads to fill unoccluded areas). 413 // FIXME: Make the gutter quads generated by the solid color layer (make it smarter about generating quads to fill unoccluded areas).
414 414
415 gfx::Rect rootTargetRect = rootLayer->renderSurface()->contentRect(); 415 gfx::Rect rootTargetRect = rootLayer->renderSurface()->contentRect();
416 float opacity = 1; 416 float opacity = 1;
417 SharedQuadState* sharedQuadState = quadCuller.useSharedQuadState(SharedQuadS tate::Create()); 417 SharedQuadState* sharedQuadState = quadCuller.useSharedQuadState(SharedQuadS tate::Create());
418 sharedQuadState->SetAll(rootLayer->drawTransform(), 418 sharedQuadState->SetAll(rootLayer->drawTransform(),
419 rootTargetRect, 419 rootTargetRect,
420 rootTargetRect, 420 rootTargetRect,
421 rootTargetRect,
422 false, 421 false,
423 opacity); 422 opacity);
424 423
425 AppendQuadsData appendQuadsData; 424 AppendQuadsData appendQuadsData;
426 425
427 gfx::Transform transformToLayerSpace(gfx::Transform::kSkipInitialization); 426 gfx::Transform transformToLayerSpace(gfx::Transform::kSkipInitialization);
428 bool didInvert = rootLayer->screenSpaceTransform().GetInverse(&transformToLa yerSpace); 427 bool didInvert = rootLayer->screenSpaceTransform().GetInverse(&transformToLa yerSpace);
429 DCHECK(didInvert); 428 DCHECK(didInvert);
430 for (Region::Iterator fillRects(fillRegion); fillRects.has_rect(); fillRects .next()) { 429 for (Region::Iterator fillRects(fillRegion); fillRects.has_rect(); fillRects .next()) {
431 // The root layer transform is composed of translations and scales only, 430 // The root layer transform is composed of translations and scales only,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 481
483 AppendQuadsData appendQuadsData(targetRenderPass->id); 482 AppendQuadsData appendQuadsData(targetRenderPass->id);
484 483
485 if (it.representsContributingRenderSurface()) { 484 if (it.representsContributingRenderSurface()) {
486 RenderPass::Id contributingRenderPassId = it->renderSurface()->rende rPassId(); 485 RenderPass::Id contributingRenderPassId = it->renderSurface()->rende rPassId();
487 RenderPass* contributingRenderPass = frame.renderPassesById[contribu tingRenderPassId]; 486 RenderPass* contributingRenderPass = frame.renderPassesById[contribu tingRenderPassId];
488 appendQuadsForRenderSurfaceLayer(targetRenderPass, *it, contributing RenderPass, occlusionTracker, appendQuadsData); 487 appendQuadsForRenderSurfaceLayer(targetRenderPass, *it, contributing RenderPass, occlusionTracker, appendQuadsData);
489 } else if (it.representsItself() && !it->visibleContentRect().IsEmpty()) { 488 } else if (it.representsItself() && !it->visibleContentRect().IsEmpty()) {
490 bool hasOcclusionFromOutsideTargetSurface; 489 bool hasOcclusionFromOutsideTargetSurface;
491 bool implDrawTransformIsUnknown = false; 490 bool implDrawTransformIsUnknown = false;
492 if (occlusionTracker.occluded(it->renderTarget(), it->visibleContent Rect(), it->drawTransform(), implDrawTransformIsUnknown, it->drawableContentRect (), &hasOcclusionFromOutsideTargetSurface)) 491 if (occlusionTracker.occluded(it->renderTarget(), it->visibleContent Rect(), it->drawTransform(), implDrawTransformIsUnknown, it->isClipped(), it->cl ipRect(), &hasOcclusionFromOutsideTargetSurface))
493 appendQuadsData.hadOcclusionFromOutsideTargetSurface |= hasOcclu sionFromOutsideTargetSurface; 492 appendQuadsData.hadOcclusionFromOutsideTargetSurface |= hasOcclu sionFromOutsideTargetSurface;
494 else { 493 else {
495 DCHECK_EQ(activeTree(), it->layerTreeImpl()); 494 DCHECK_EQ(activeTree(), it->layerTreeImpl());
496 it->willDraw(m_resourceProvider.get()); 495 it->willDraw(m_resourceProvider.get());
497 frame.willDrawLayers.push_back(*it); 496 frame.willDrawLayers.push_back(*it);
498 497
499 if (it->hasContributingDelegatedRenderPasses()) { 498 if (it->hasContributingDelegatedRenderPasses()) {
500 RenderPass::Id contributingRenderPassId = it->firstContribut ingRenderPassId(); 499 RenderPass::Id contributingRenderPassId = it->firstContribut ingRenderPassId();
501 while (frame.renderPassesById.find(contributingRenderPassId) != frame.renderPassesById.end()) { 500 while (frame.renderPassesById.find(contributingRenderPassId) != frame.renderPassesById.end()) {
502 RenderPass* renderPass = frame.renderPassesById[contribu tingRenderPassId]; 501 RenderPass* renderPass = frame.renderPassesById[contribu tingRenderPassId];
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1690 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); 1689 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer());
1691 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); 1690 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>();
1692 } 1691 }
1693 1692
1694 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime) 1693 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime)
1695 { 1694 {
1696 m_paintTimeCounter->SavePaintTime(totalPaintTime); 1695 m_paintTimeCounter->SavePaintTime(totalPaintTime);
1697 } 1696 }
1698 1697
1699 } // namespace cc 1698 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_impl.cc ('k') | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698