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

Side by Side Diff: cc/layers/surface_layer.cc

Issue 2755803003: cc: Remove SetNeedsCommitNoRebuild from Layer API (Closed)
Patch Set: address review comments Created 3 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/layers/surface_layer.h" 5 #include "cc/layers/surface_layer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 64
65 void SurfaceLayer::SetPrimarySurfaceInfo(const SurfaceInfo& surface_info) { 65 void SurfaceLayer::SetPrimarySurfaceInfo(const SurfaceInfo& surface_info) {
66 RemoveReference(std::move(primary_reference_returner_)); 66 RemoveReference(std::move(primary_reference_returner_));
67 primary_surface_info_ = surface_info; 67 primary_surface_info_ = surface_info;
68 if (layer_tree_host()) { 68 if (layer_tree_host()) {
69 primary_reference_returner_ = ref_factory_->CreateReference( 69 primary_reference_returner_ = ref_factory_->CreateReference(
70 layer_tree_host(), primary_surface_info_.id()); 70 layer_tree_host(), primary_surface_info_.id());
71 } 71 }
72 UpdateDrawsContent(HasDrawableContent()); 72 UpdateDrawsContent(HasDrawableContent());
73 SetNeedsCommitNoRebuild(); 73 SetNeedsCommit();
74 } 74 }
75 75
76 void SurfaceLayer::SetFallbackSurfaceInfo(const SurfaceInfo& surface_info) { 76 void SurfaceLayer::SetFallbackSurfaceInfo(const SurfaceInfo& surface_info) {
77 RemoveReference(std::move(fallback_reference_returner_)); 77 RemoveReference(std::move(fallback_reference_returner_));
78 fallback_surface_info_ = surface_info; 78 fallback_surface_info_ = surface_info;
79 if (layer_tree_host()) { 79 if (layer_tree_host()) {
80 fallback_reference_returner_ = ref_factory_->CreateReference( 80 fallback_reference_returner_ = ref_factory_->CreateReference(
81 layer_tree_host(), fallback_surface_info_.id()); 81 layer_tree_host(), fallback_surface_info_.id());
82 } 82 }
83 SetNeedsCommitNoRebuild(); 83 SetNeedsCommit();
84 } 84 }
85 85
86 void SurfaceLayer::SetStretchContentToFillBounds( 86 void SurfaceLayer::SetStretchContentToFillBounds(
87 bool stretch_content_to_fill_bounds) { 87 bool stretch_content_to_fill_bounds) {
88 stretch_content_to_fill_bounds_ = stretch_content_to_fill_bounds; 88 stretch_content_to_fill_bounds_ = stretch_content_to_fill_bounds;
89 SetNeedsPushProperties(); 89 SetNeedsPushProperties();
90 } 90 }
91 91
92 std::unique_ptr<LayerImpl> SurfaceLayer::CreateLayerImpl( 92 std::unique_ptr<LayerImpl> SurfaceLayer::CreateLayerImpl(
93 LayerTreeImpl* tree_impl) { 93 LayerTreeImpl* tree_impl) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 if (!reference_returner) 131 if (!reference_returner)
132 return; 132 return;
133 auto swap_promise = base::MakeUnique<SatisfySwapPromise>( 133 auto swap_promise = base::MakeUnique<SatisfySwapPromise>(
134 std::move(reference_returner), 134 std::move(reference_returner),
135 layer_tree_host()->GetTaskRunnerProvider()->MainThreadTaskRunner()); 135 layer_tree_host()->GetTaskRunnerProvider()->MainThreadTaskRunner());
136 layer_tree_host()->GetSwapPromiseManager()->QueueSwapPromise( 136 layer_tree_host()->GetSwapPromiseManager()->QueueSwapPromise(
137 std::move(swap_promise)); 137 std::move(swap_promise));
138 } 138 }
139 139
140 } // namespace cc 140 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698