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

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 1135743004: cc: Add null checks for GrContext created by ContextProviderCommandBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Worker context provider's lock must be held during GrContext creation. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 5913 matching lines...) Expand 10 before | Expand all | Expand 10 after
5924 EXPECT_EQ(nothing_cutoff_value, current_priority_cutoff_value_); 5924 EXPECT_EQ(nothing_cutoff_value, current_priority_cutoff_value_);
5925 5925
5926 host_impl_->SetVisible(true); 5926 host_impl_->SetVisible(true);
5927 EXPECT_EQ(policy1.bytes_limit_when_visible, current_limit_bytes_); 5927 EXPECT_EQ(policy1.bytes_limit_when_visible, current_limit_bytes_);
5928 EXPECT_EQ(everything_cutoff_value, current_priority_cutoff_value_); 5928 EXPECT_EQ(everything_cutoff_value, current_priority_cutoff_value_);
5929 5929
5930 // Now enable GPU rasterization and test if we get nice to have cutoff, 5930 // Now enable GPU rasterization and test if we get nice to have cutoff,
5931 // when visible. 5931 // when visible.
5932 LayerTreeSettings settings; 5932 LayerTreeSettings settings;
5933 settings.gpu_rasterization_enabled = true; 5933 settings.gpu_rasterization_enabled = true;
5934 host_impl_ = LayerTreeHostImpl::Create( 5934 CreateHostImpl(settings, CreateOutputSurface());
5935 settings, this, &proxy_, &stats_instrumentation_, NULL, NULL, NULL, 0);
5936 host_impl_->set_content_is_suitable_for_gpu_rasterization(true); 5935 host_impl_->set_content_is_suitable_for_gpu_rasterization(true);
5937 host_impl_->set_has_gpu_rasterization_trigger(true); 5936 host_impl_->set_has_gpu_rasterization_trigger(true);
5938 host_impl_->UpdateGpuRasterizationStatus(); 5937 host_impl_->UpdateGpuRasterizationStatus();
5939 host_impl_->SetVisible(true); 5938 host_impl_->SetVisible(true);
5940 host_impl_->SetMemoryPolicy(policy1); 5939 host_impl_->SetMemoryPolicy(policy1);
5941 EXPECT_EQ(policy1.bytes_limit_when_visible, current_limit_bytes_); 5940 EXPECT_EQ(policy1.bytes_limit_when_visible, current_limit_bytes_);
5942 EXPECT_EQ(allow_nice_to_have_cutoff_value, current_priority_cutoff_value_); 5941 EXPECT_EQ(allow_nice_to_have_cutoff_value, current_priority_cutoff_value_);
5943 5942
5944 host_impl_->SetVisible(false); 5943 host_impl_->SetVisible(false);
5945 EXPECT_EQ(0u, current_limit_bytes_); 5944 EXPECT_EQ(0u, current_limit_bytes_);
(...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after
7780 host_impl_->set_has_gpu_rasterization_trigger(false); 7779 host_impl_->set_has_gpu_rasterization_trigger(false);
7781 host_impl_->set_content_is_suitable_for_gpu_rasterization(false); 7780 host_impl_->set_content_is_suitable_for_gpu_rasterization(false);
7782 host_impl_->UpdateGpuRasterizationStatus(); 7781 host_impl_->UpdateGpuRasterizationStatus();
7783 EXPECT_EQ(GpuRasterizationStatus::ON_FORCED, 7782 EXPECT_EQ(GpuRasterizationStatus::ON_FORCED,
7784 host_impl_->gpu_rasterization_status()); 7783 host_impl_->gpu_rasterization_status());
7785 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); 7784 EXPECT_TRUE(host_impl_->use_gpu_rasterization());
7786 } 7785 }
7787 7786
7788 } // namespace 7787 } // namespace
7789 } // namespace cc 7788 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | content/common/gpu/client/context_provider_command_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698