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

Side by Side Diff: ui/compositor/layer.cc

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Improve with comment in patch 18. Created 3 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
« cc/trees/damage_tracker_unittest.cc ('K') | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 SetLayerFilters(); 647 SetLayerFilters();
648 SetLayerBackgroundFilters(); 648 SetLayerBackgroundFilters();
649 } 649 }
650 650
651 void Layer::SwitchCCLayerForTest() { 651 void Layer::SwitchCCLayerForTest() {
652 scoped_refptr<cc::Layer> new_layer = cc::PictureLayer::Create(this); 652 scoped_refptr<cc::Layer> new_layer = cc::PictureLayer::Create(this);
653 SwitchToLayer(new_layer); 653 SwitchToLayer(new_layer);
654 content_layer_ = new_layer; 654 content_layer_ = new_layer;
655 } 655 }
656 656
657 void Layer::SetCacheRenderSurface(bool cache_render_surface) {
658 cc_layer_->SetCacheRenderSurface(cache_render_surface);
danakj 2017/07/28 22:22:58 You should leave a comment explaining why Clone()
danakj 2017/07/28 22:32:45 Adding a comment to explain why not propogated to
wutao 2017/07/28 23:38:58 Added a comment and two tests for cloning and swit
659 }
660
657 void Layer::SetTextureMailbox( 661 void Layer::SetTextureMailbox(
658 const viz::TextureMailbox& mailbox, 662 const viz::TextureMailbox& mailbox,
659 std::unique_ptr<viz::SingleReleaseCallback> release_callback, 663 std::unique_ptr<viz::SingleReleaseCallback> release_callback,
660 gfx::Size texture_size_in_dip) { 664 gfx::Size texture_size_in_dip) {
661 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); 665 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR);
662 DCHECK(mailbox.IsValid()); 666 DCHECK(mailbox.IsValid());
663 DCHECK(release_callback); 667 DCHECK(release_callback);
664 if (!texture_layer_.get()) { 668 if (!texture_layer_.get()) {
665 scoped_refptr<cc::TextureLayer> new_layer = 669 scoped_refptr<cc::TextureLayer> new_layer =
666 cc::TextureLayer::CreateForMailbox(this); 670 cc::TextureLayer::CreateForMailbox(this);
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), 1258 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(),
1255 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { 1259 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) {
1256 return mirror_ptr.get() == mirror; 1260 return mirror_ptr.get() == mirror;
1257 }); 1261 });
1258 1262
1259 DCHECK(it != mirrors_.end()); 1263 DCHECK(it != mirrors_.end());
1260 mirrors_.erase(it); 1264 mirrors_.erase(it);
1261 } 1265 }
1262 1266
1263 } // namespace ui 1267 } // namespace ui
OLDNEW
« cc/trees/damage_tracker_unittest.cc ('K') | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698