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

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

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Fix compile error. Created 3 years, 5 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 (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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 SetLayerFilters(); 635 SetLayerFilters();
636 SetLayerBackgroundFilters(); 636 SetLayerBackgroundFilters();
637 } 637 }
638 638
639 void Layer::SwitchCCLayerForTest() { 639 void Layer::SwitchCCLayerForTest() {
640 scoped_refptr<cc::Layer> new_layer = cc::PictureLayer::Create(this); 640 scoped_refptr<cc::Layer> new_layer = cc::PictureLayer::Create(this);
641 SwitchToLayer(new_layer); 641 SwitchToLayer(new_layer);
642 content_layer_ = new_layer; 642 content_layer_ = new_layer;
643 } 643 }
644 644
645 void Layer::SetCacheRenderSurface(bool cache_render_surface) {
646 cc_layer_->SetCacheRenderSurface(cache_render_surface);
647 }
648
645 void Layer::SetTextureMailbox( 649 void Layer::SetTextureMailbox(
646 const cc::TextureMailbox& mailbox, 650 const cc::TextureMailbox& mailbox,
647 std::unique_ptr<cc::SingleReleaseCallback> release_callback, 651 std::unique_ptr<cc::SingleReleaseCallback> release_callback,
648 gfx::Size texture_size_in_dip) { 652 gfx::Size texture_size_in_dip) {
649 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); 653 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR);
650 DCHECK(mailbox.IsValid()); 654 DCHECK(mailbox.IsValid());
651 DCHECK(release_callback); 655 DCHECK(release_callback);
652 if (!texture_layer_.get()) { 656 if (!texture_layer_.get()) {
653 scoped_refptr<cc::TextureLayer> new_layer = 657 scoped_refptr<cc::TextureLayer> new_layer =
654 cc::TextureLayer::CreateForMailbox(this); 658 cc::TextureLayer::CreateForMailbox(this);
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), 1246 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(),
1243 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { 1247 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) {
1244 return mirror_ptr.get() == mirror; 1248 return mirror_ptr.get() == mirror;
1245 }); 1249 });
1246 1250
1247 DCHECK(it != mirrors_.end()); 1251 DCHECK(it != mirrors_.end());
1248 mirrors_.erase(it); 1252 mirrors_.erase(it);
1249 } 1253 }
1250 1254
1251 } // namespace ui 1255 } // namespace ui
OLDNEW
« cc/trees/layer_tree_host_common_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