| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |