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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 222903005: cc: Let skia veto gpu rasterization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added comment about SetNeedsCommit Created 6 years, 8 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/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 57becf43969808505f265f6c032ecf22ea6be495..7dac9948030d79322c3246dc5c539503f8beb073 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -54,8 +54,8 @@ PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl, int id)
is_using_lcd_text_(tree_impl->settings().can_use_lcd_text),
needs_post_commit_initialization_(true),
should_update_tile_priorities_(false),
- has_gpu_rasterization_hint_(false),
should_use_low_res_tiling_(tree_impl->settings().create_low_res_tiling),
+ use_gpu_rasterization_(false),
layer_needs_to_register_itself_(true) {}
PictureLayerImpl::~PictureLayerImpl() {
@@ -96,7 +96,7 @@ void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) {
layer_impl->SetIsMask(is_mask_);
layer_impl->pile_ = pile_;
- layer_impl->SetHasGpuRasterizationHint(has_gpu_rasterization_hint_);
+ layer_impl->use_gpu_rasterization_ = use_gpu_rasterization_;
// Tilings would be expensive to push, so we swap.
layer_impl->tilings_.swap(tilings_);
@@ -490,24 +490,12 @@ skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() {
return pile_->GetFlattenedPicture();
}
-void PictureLayerImpl::SetHasGpuRasterizationHint(bool has_hint) {
- bool old_should_use_gpu_rasterization = ShouldUseGpuRasterization();
- has_gpu_rasterization_hint_ = has_hint;
- if (ShouldUseGpuRasterization() != old_should_use_gpu_rasterization)
- RemoveAllTilings();
-}
+void PictureLayerImpl::SetUseGpuRasterization(bool use_gpu) {
+ if (use_gpu_rasterization_ == use_gpu)
+ return;
-bool PictureLayerImpl::ShouldUseGpuRasterization() const {
- switch (layer_tree_impl()->settings().rasterization_site) {
- case LayerTreeSettings::CpuRasterization:
- return false;
- case LayerTreeSettings::HybridRasterization:
- return has_gpu_rasterization_hint_;
- case LayerTreeSettings::GpuRasterization:
- return true;
- }
- NOTREACHED();
- return false;
+ use_gpu_rasterization_ = use_gpu;
+ RemoveAllTilings();
}
scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling,
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698