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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1134123005: cc: split UpdateGpuRasterizationStatus() into two parts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 4df38079d7e90d537a30baacd0557964e6af7b1b..d5e6ad6871d758ac363791e23d77d28e384d95dc 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -195,6 +195,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
use_gpu_rasterization_(false),
use_msaa_(false),
gpu_rasterization_status_(GpuRasterizationStatus::OFF_DEVICE),
+ tree_resources_for_gpu_rasterization_dirty_(false),
input_handler_client_(NULL),
did_lock_scrolling_layer_(false),
should_bubble_scrolls_(false),
@@ -308,7 +309,9 @@ void LayerTreeHostImpl::BeginCommit() {
void LayerTreeHostImpl::CommitComplete() {
TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete");
- UpdateGpuRasterizationStatus();
+ // LayerTreeHost may have changed the GPU rasterization flags state, which
+ // may require an update of the tree resources.
+ UpdateTreeResourcesForGpuRasterizationIfNeeded();
sync_tree()->set_needs_update_draw_properties();
if (settings_.impl_side_painting) {
@@ -1646,6 +1649,13 @@ void LayerTreeHostImpl::UpdateGpuRasterizationStatus() {
use_gpu_rasterization_ = use_gpu;
use_msaa_ = use_msaa;
+ tree_resources_for_gpu_rasterization_dirty_ = true;
+}
+
+void LayerTreeHostImpl::UpdateTreeResourcesForGpuRasterizationIfNeeded() {
+ if (!tree_resources_for_gpu_rasterization_dirty_)
+ return;
+
// Clean up and replace existing tile manager with another one that uses
// appropriate rasterizer.
ReleaseTreeResources();
@@ -1659,6 +1669,8 @@ void LayerTreeHostImpl::UpdateGpuRasterizationStatus() {
// We would not have any content to draw until the pending tree is activated.
// Prevent the active tree from drawing until activation.
SetRequiresHighResToDraw();
+
+ tree_resources_for_gpu_rasterization_dirty_ = false;
}
const RendererCapabilitiesImpl&
@@ -2015,8 +2027,6 @@ void LayerTreeHostImpl::CreateAndSetRenderer() {
}
DCHECK(renderer_);
- // Since the new renderer may be capable of MSAA, update status here.
- UpdateGpuRasterizationStatus();
renderer_->SetVisible(visible_);
SetFullRootLayerDamage();
@@ -2201,6 +2211,9 @@ bool LayerTreeHostImpl::InitializeRenderer(
CreateAndSetRenderer();
+ // Since the new renderer may be capable of MSAA, update status here.
+ UpdateGpuRasterizationStatus();
+
if (settings_.impl_side_painting && settings_.raster_enabled)
CreateAndSetTileManager();
RecreateTreeResources();
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698