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

Side by Side Diff: cc/layers/nine_patch_layer_impl.cc

Issue 2018263002: Change LayerImpl::LayerTreeAsJson to return a std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « cc/layers/nine_patch_layer_impl.h ('k') | cc/layers/ui_resource_layer_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/layers/nine_patch_layer_impl.h" 5 #include "cc/layers/nine_patch_layer_impl.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/quads/texture_draw_quad.h" 10 #include "cc/quads/texture_draw_quad.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 vertex_opacity, flipped, nearest_neighbor_, false); 343 vertex_opacity, flipped, nearest_neighbor_, false);
344 ValidateQuadResources(quad); 344 ValidateQuadResources(quad);
345 } 345 }
346 } 346 }
347 } 347 }
348 348
349 const char* NinePatchLayerImpl::LayerTypeAsString() const { 349 const char* NinePatchLayerImpl::LayerTypeAsString() const {
350 return "cc::NinePatchLayerImpl"; 350 return "cc::NinePatchLayerImpl";
351 } 351 }
352 352
353 base::DictionaryValue* NinePatchLayerImpl::LayerTreeAsJson() const { 353 std::unique_ptr<base::DictionaryValue> NinePatchLayerImpl::LayerTreeAsJson()
354 base::DictionaryValue* result = LayerImpl::LayerTreeAsJson(); 354 const {
355 std::unique_ptr<base::DictionaryValue> result = LayerImpl::LayerTreeAsJson();
355 356
356 base::ListValue* list = new base::ListValue; 357 base::ListValue* list = new base::ListValue;
357 list->AppendInteger(image_aperture_.origin().x()); 358 list->AppendInteger(image_aperture_.origin().x());
358 list->AppendInteger(image_aperture_.origin().y()); 359 list->AppendInteger(image_aperture_.origin().y());
359 list->AppendInteger(image_aperture_.size().width()); 360 list->AppendInteger(image_aperture_.size().width());
360 list->AppendInteger(image_aperture_.size().height()); 361 list->AppendInteger(image_aperture_.size().height());
361 result->Set("ImageAperture", list); 362 result->Set("ImageAperture", list);
362 363
363 list = new base::ListValue; 364 list = new base::ListValue;
364 list->AppendInteger(image_bounds_.width()); 365 list->AppendInteger(image_bounds_.width());
365 list->AppendInteger(image_bounds_.height()); 366 list->AppendInteger(image_bounds_.height());
366 result->Set("ImageBounds", list); 367 result->Set("ImageBounds", list);
367 368
368 result->Set("Border", MathUtil::AsValue(border_).release()); 369 result->Set("Border", MathUtil::AsValue(border_).release());
369 370
370 result->SetBoolean("FillCenter", fill_center_); 371 result->SetBoolean("FillCenter", fill_center_);
371 372
372 return result; 373 return result;
373 } 374 }
374 375
375 } // namespace cc 376 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/nine_patch_layer_impl.h ('k') | cc/layers/ui_resource_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698