Chromium Code Reviews| 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); |