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

Unified Diff: cc/layers/picture_image_layer.cc

Issue 1835523002: cc: Add LayerTreeSetting to disable cached picture raster. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_image_layer.cc
diff --git a/cc/layers/picture_image_layer.cc b/cc/layers/picture_image_layer.cc
index 3c17c8c3bbae66f9607a31e4161e7e4793f89377..243223909e4af1ba0cc7b410028ee7701aa602df 100644
--- a/cc/layers/picture_image_layer.cc
+++ b/cc/layers/picture_image_layer.cc
@@ -6,6 +6,8 @@
#include <stddef.h>
+#include "base/command_line.h"
+#include "cc/base/switches.h"
#include "cc/layers/picture_image_layer_impl.h"
#include "cc/playback/display_item_list_settings.h"
#include "cc/playback/drawing_display_item.h"
@@ -16,6 +18,15 @@
namespace cc {
+namespace {
+
+static bool UseCachedPictureRaster() {
vmpstr 2016/03/25 21:45:12 Is it possible to plumb this through layer tree se
Khushal 2016/03/25 21:53:48 Sure I can add a LayerTreeSetting for this. Yup, c
+ static bool use = !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableCachedPictureRaster);
+ return use;
+}
+}
+
scoped_refptr<PictureImageLayer> PictureImageLayer::Create() {
return make_scoped_refptr(new PictureImageLayer());
}
@@ -58,10 +69,8 @@ scoped_refptr<DisplayItemList> PictureImageLayer::PaintContentsToDisplayList(
DCHECK_GT(image_->width(), 0);
DCHECK_GT(image_->height(), 0);
- // Picture image layers can be used with GatherPixelRefs, so cached SkPictures
- // are currently required.
DisplayItemListSettings settings;
- settings.use_cached_picture = true;
+ settings.use_cached_picture = UseCachedPictureRaster();
scoped_refptr<DisplayItemList> display_list =
DisplayItemList::Create(PaintableRegion(), settings);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698