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

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

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Created 3 years, 7 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
« ui/compositor/layer.h ('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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 SetLayerFilters(); 622 SetLayerFilters();
623 SetLayerBackgroundFilters(); 623 SetLayerBackgroundFilters();
624 } 624 }
625 625
626 void Layer::SwitchCCLayerForTest() { 626 void Layer::SwitchCCLayerForTest() {
627 scoped_refptr<cc::Layer> new_layer = cc::PictureLayer::Create(this); 627 scoped_refptr<cc::Layer> new_layer = cc::PictureLayer::Create(this);
628 SwitchToLayer(new_layer); 628 SwitchToLayer(new_layer);
629 content_layer_ = new_layer; 629 content_layer_ = new_layer;
630 } 630 }
631 631
632 void Layer::SetForceRenderSurface(bool force) {
633 cc_layer_->SetForceRenderSurface(force);
634 }
635
632 void Layer::SetTextureMailbox( 636 void Layer::SetTextureMailbox(
633 const cc::TextureMailbox& mailbox, 637 const cc::TextureMailbox& mailbox,
634 std::unique_ptr<cc::SingleReleaseCallback> release_callback, 638 std::unique_ptr<cc::SingleReleaseCallback> release_callback,
635 gfx::Size texture_size_in_dip) { 639 gfx::Size texture_size_in_dip) {
636 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); 640 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR);
637 DCHECK(mailbox.IsValid()); 641 DCHECK(mailbox.IsValid());
638 DCHECK(release_callback); 642 DCHECK(release_callback);
639 if (!texture_layer_.get()) { 643 if (!texture_layer_.get()) {
640 scoped_refptr<cc::TextureLayer> new_layer = 644 scoped_refptr<cc::TextureLayer> new_layer =
641 cc::TextureLayer::CreateForMailbox(this); 645 cc::TextureLayer::CreateForMailbox(this);
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), 1231 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(),
1228 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { 1232 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) {
1229 return mirror_ptr.get() == mirror; 1233 return mirror_ptr.get() == mirror;
1230 }); 1234 });
1231 1235
1232 DCHECK(it != mirrors_.end()); 1236 DCHECK(it != mirrors_.end());
1233 mirrors_.erase(it); 1237 mirrors_.erase(it);
1234 } 1238 }
1235 1239
1236 } // namespace ui 1240 } // namespace ui
OLDNEW
« ui/compositor/layer.h ('K') | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698