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

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

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Fix for comments in patch 4. Created 3 years, 6 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.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 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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), 1244 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(),
1241 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { 1245 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) {
1242 return mirror_ptr.get() == mirror; 1246 return mirror_ptr.get() == mirror;
1243 }); 1247 });
1244 1248
1245 DCHECK(it != mirrors_.end()); 1249 DCHECK(it != mirrors_.end());
1246 mirrors_.erase(it); 1250 mirrors_.erase(it);
1247 } 1251 }
1248 1252
1249 } // namespace ui 1253 } // namespace ui
OLDNEW
« cc/trees/damage_tracker.cc ('K') | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698