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

Unified Diff: cc/test/layer_tree_json_parser.cc

Issue 1122393003: CC: Plumb LayerSettings parameter for cc::Layer construction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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/test/layer_tree_host_common_test.h ('k') | cc/test/layer_tree_pixel_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_json_parser.cc
diff --git a/cc/test/layer_tree_json_parser.cc b/cc/test/layer_tree_json_parser.cc
index b0b81f7e803fe3260300d79ae4263c6418b54619..9d9163cd1bb26dc05f8030536326501aec6db63f 100644
--- a/cc/test/layer_tree_json_parser.cc
+++ b/cc/test/layer_tree_json_parser.cc
@@ -12,6 +12,7 @@
#include "cc/layers/picture_layer.h"
#include "cc/layers/solid_color_layer.h"
#include "cc/layers/texture_layer.h"
+#include "cc/trees/layer_tree_settings.h"
namespace cc {
@@ -37,11 +38,13 @@ scoped_refptr<Layer> ParseTreeFromValue(base::Value* val,
bool draws_content;
success &= dict->GetBoolean("DrawsContent", &draws_content);
+ LayerSettings layer_settings;
+
scoped_refptr<Layer> new_layer;
if (layer_type == "SolidColorLayer") {
- new_layer = SolidColorLayer::Create();
+ new_layer = SolidColorLayer::Create(layer_settings);
} else if (layer_type == "ContentLayer") {
- new_layer = ContentLayer::Create(content_client);
+ new_layer = ContentLayer::Create(layer_settings, content_client);
} else if (layer_type == "NinePatchLayer") {
success &= dict->GetList("ImageAperture", &list);
int aperture_x, aperture_y, aperture_width, aperture_height;
@@ -66,7 +69,8 @@ scoped_refptr<Layer> ParseTreeFromValue(base::Value* val,
bool fill_center;
success &= dict->GetBoolean("FillCenter", &fill_center);
- scoped_refptr<NinePatchLayer> nine_patch_layer = NinePatchLayer::Create();
+ scoped_refptr<NinePatchLayer> nine_patch_layer =
+ NinePatchLayer::Create(layer_settings);
SkBitmap bitmap;
bitmap.allocN32Pixels(image_width, image_height);
@@ -80,11 +84,11 @@ scoped_refptr<Layer> ParseTreeFromValue(base::Value* val,
new_layer = nine_patch_layer;
} else if (layer_type == "TextureLayer") {
- new_layer = TextureLayer::CreateForMailbox(NULL);
+ new_layer = TextureLayer::CreateForMailbox(layer_settings, NULL);
} else if (layer_type == "PictureLayer") {
- new_layer = PictureLayer::Create(content_client);
+ new_layer = PictureLayer::Create(layer_settings, content_client);
} else { // Type "Layer" or "unknown"
- new_layer = Layer::Create();
+ new_layer = Layer::Create(layer_settings);
}
new_layer->SetPosition(gfx::PointF(position_x, position_y));
new_layer->SetBounds(gfx::Size(width, height));
« no previous file with comments | « cc/test/layer_tree_host_common_test.h ('k') | cc/test/layer_tree_pixel_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698