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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp

Issue 1632263002: Calculate and track display item opaqueness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix print output and add some commentary Created 4 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "platform/graphics/compositing/PaintArtifactCompositor.h" 5 #include "platform/graphics/compositing/PaintArtifactCompositor.h"
6 6
7 #include "cc/layers/content_layer_client.h" 7 #include "cc/layers/content_layer_client.h"
8 #include "cc/layers/layer.h" 8 #include "cc/layers/layer.h"
9 #include "cc/layers/layer_settings.h" 9 #include "cc/layers/layer_settings.h"
10 #include "cc/layers/picture_layer.h" 10 #include "cc/layers/picture_layer.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 gfx::Rect combinedBounds = enclosingIntRect(paintChunk.bounds); 133 gfx::Rect combinedBounds = enclosingIntRect(paintChunk.bounds);
134 scoped_refptr<cc::DisplayItemList> displayList = recordPaintChunk(paintA rtifact, paintChunk, combinedBounds); 134 scoped_refptr<cc::DisplayItemList> displayList = recordPaintChunk(paintA rtifact, paintChunk, combinedBounds);
135 OwnPtr<ContentLayerClientImpl> contentLayerClient = adoptPtr( 135 OwnPtr<ContentLayerClientImpl> contentLayerClient = adoptPtr(
136 new ContentLayerClientImpl(std::move(displayList), gfx::Rect(combine dBounds.size()))); 136 new ContentLayerClientImpl(std::move(displayList), gfx::Rect(combine dBounds.size())));
137 137
138 scoped_refptr<cc::PictureLayer> layer = cc::PictureLayer::Create(cc::Lay erSettings(), contentLayerClient.get()); 138 scoped_refptr<cc::PictureLayer> layer = cc::PictureLayer::Create(cc::Lay erSettings(), contentLayerClient.get());
139 layer->SetPosition(gfx::PointF(combinedBounds.origin())); 139 layer->SetPosition(gfx::PointF(combinedBounds.origin()));
140 layer->SetBounds(combinedBounds.size()); 140 layer->SetBounds(combinedBounds.size());
141 layer->SetTransform(transformToRoot(paintChunk.properties.transform.get( ))); 141 layer->SetTransform(transformToRoot(paintChunk.properties.transform.get( )));
142 layer->SetIsDrawable(true); 142 layer->SetIsDrawable(true);
143 if (paintChunk.knownToBeOpaque)
144 layer->SetContentsOpaque(true);
143 layer->SetNeedsDisplay(); 145 layer->SetNeedsDisplay();
144 146
145 m_contentLayerClients.append(contentLayerClient.release()); 147 m_contentLayerClients.append(contentLayerClient.release());
146 m_rootLayer->AddChild(std::move(layer)); 148 m_rootLayer->AddChild(std::move(layer));
147 } 149 }
148 } 150 }
149 151
150 } // namespace blink 152 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698