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

Side by Side Diff: cc/test/layer_tree_json_parser.cc

Issue 197883017: SkColorType instead of (deprecated) SkBitmap::Config (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/test/layer_tree_json_parser.h" 5 #include "cc/test/layer_tree_json_parser.h"
6 6
7 #include "base/test/values_test_util.h" 7 #include "base/test/values_test_util.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "cc/layers/content_layer.h" 9 #include "cc/layers/content_layer.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 success &= list->GetInteger(1, &border_y); 62 success &= list->GetInteger(1, &border_y);
63 success &= list->GetInteger(2, &border_width); 63 success &= list->GetInteger(2, &border_width);
64 success &= list->GetInteger(3, &border_height); 64 success &= list->GetInteger(3, &border_height);
65 65
66 bool fill_center; 66 bool fill_center;
67 success &= dict->GetBoolean("FillCenter", &fill_center); 67 success &= dict->GetBoolean("FillCenter", &fill_center);
68 68
69 scoped_refptr<NinePatchLayer> nine_patch_layer = NinePatchLayer::Create(); 69 scoped_refptr<NinePatchLayer> nine_patch_layer = NinePatchLayer::Create();
70 70
71 SkBitmap bitmap; 71 SkBitmap bitmap;
72 bitmap.setConfig(SkBitmap::kARGB_8888_Config, image_width, image_height); 72 bitmap.setConfig(SkImageInfo::MakeN32Premul(image_width, image_height));
73 bitmap.allocPixels(NULL, NULL);
74 bitmap.setImmutable(); 73 bitmap.setImmutable();
75 nine_patch_layer->SetBitmap(bitmap); 74 nine_patch_layer->SetBitmap(bitmap);
76 nine_patch_layer->SetAperture( 75 nine_patch_layer->SetAperture(
77 gfx::Rect(aperture_x, aperture_y, aperture_width, aperture_height)); 76 gfx::Rect(aperture_x, aperture_y, aperture_width, aperture_height));
78 nine_patch_layer->SetBorder( 77 nine_patch_layer->SetBorder(
79 gfx::Rect(border_x, border_y, border_width, border_height)); 78 gfx::Rect(border_x, border_y, border_width, border_height));
80 nine_patch_layer->SetFillCenter(fill_center); 79 nine_patch_layer->SetFillCenter(fill_center);
81 80
82 new_layer = nine_patch_layer; 81 new_layer = nine_patch_layer;
83 } else if (layer_type == "TextureLayer") { 82 } else if (layer_type == "TextureLayer") {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 163
165 } // namespace 164 } // namespace
166 165
167 scoped_refptr<Layer> ParseTreeFromJson(std::string json, 166 scoped_refptr<Layer> ParseTreeFromJson(std::string json,
168 ContentLayerClient* content_client) { 167 ContentLayerClient* content_client) {
169 scoped_ptr<base::Value> val = base::test::ParseJson(json); 168 scoped_ptr<base::Value> val = base::test::ParseJson(json);
170 return ParseTreeFromValue(val.get(), content_client); 169 return ParseTreeFromValue(val.get(), content_client);
171 } 170 }
172 171
173 } // namespace cc 172 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698