OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/quads/nine_patch_generator.h" | 5 #include "cc/quads/nine_patch_generator.h" |
6 | 6 |
7 #include "cc/layers/draw_properties.h" | 7 #include "cc/layers/draw_properties.h" |
8 #include "cc/quads/render_pass.h" | 8 #include "cc/quads/render_pass.h" |
9 #include "cc/quads/texture_draw_quad.h" | 9 #include "cc/quads/texture_draw_quad.h" |
10 #include "cc/trees/layer_tree_impl.h" | 10 #include "cc/trees/layer_tree_impl.h" |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 quad->SetNew(shared_quad_state, output_rect, opaque_rect, visible_rect, | 362 quad->SetNew(shared_quad_state, output_rect, opaque_rect, visible_rect, |
363 resource, premultiplied_alpha, image_rect.origin(), | 363 resource, premultiplied_alpha, image_rect.origin(), |
364 image_rect.bottom_right(), SK_ColorTRANSPARENT, | 364 image_rect.bottom_right(), SK_ColorTRANSPARENT, |
365 vertex_opacity, flipped, nearest_neighbor_, false); | 365 vertex_opacity, flipped, nearest_neighbor_, false); |
366 layer_impl->ValidateQuadResources(quad); | 366 layer_impl->ValidateQuadResources(quad); |
367 } | 367 } |
368 } | 368 } |
369 } | 369 } |
370 | 370 |
371 void NinePatchGenerator::AsJson(base::DictionaryValue* dictionary) const { | 371 void NinePatchGenerator::AsJson(base::DictionaryValue* dictionary) const { |
372 base::ListValue* list = new base::ListValue; | 372 auto list = base::MakeUnique<base::ListValue>(); |
373 list->AppendInteger(image_aperture_.origin().x()); | 373 list->AppendInteger(image_aperture_.origin().x()); |
374 list->AppendInteger(image_aperture_.origin().y()); | 374 list->AppendInteger(image_aperture_.origin().y()); |
375 list->AppendInteger(image_aperture_.size().width()); | 375 list->AppendInteger(image_aperture_.size().width()); |
376 list->AppendInteger(image_aperture_.size().height()); | 376 list->AppendInteger(image_aperture_.size().height()); |
377 dictionary->Set("ImageAperture", list); | 377 dictionary->Set("ImageAperture", std::move(list)); |
378 | 378 |
379 list = new base::ListValue; | 379 list = base::MakeUnique<base::ListValue>(); |
380 list->AppendInteger(image_bounds_.width()); | 380 list->AppendInteger(image_bounds_.width()); |
381 list->AppendInteger(image_bounds_.height()); | 381 list->AppendInteger(image_bounds_.height()); |
382 dictionary->Set("ImageBounds", list); | 382 dictionary->Set("ImageBounds", std::move(list)); |
383 | 383 |
384 dictionary->Set("Border", MathUtil::AsValue(border_).release()); | 384 dictionary->Set("Border", MathUtil::AsValue(border_)); |
385 | 385 |
386 dictionary->SetBoolean("FillCenter", fill_center_); | 386 dictionary->SetBoolean("FillCenter", fill_center_); |
387 | 387 |
388 list = new base::ListValue; | 388 list = base::MakeUnique<base::ListValue>(); |
389 list->AppendInteger(output_occlusion_.x()); | 389 list->AppendInteger(output_occlusion_.x()); |
390 list->AppendInteger(output_occlusion_.y()); | 390 list->AppendInteger(output_occlusion_.y()); |
391 list->AppendInteger(output_occlusion_.width()); | 391 list->AppendInteger(output_occlusion_.width()); |
392 list->AppendInteger(output_occlusion_.height()); | 392 list->AppendInteger(output_occlusion_.height()); |
393 dictionary->Set("OutputOcclusion", list); | 393 dictionary->Set("OutputOcclusion", std::move(list)); |
394 } | 394 } |
395 | 395 |
396 } // namespace cc | 396 } // namespace cc |
OLD | NEW |