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/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "cc/layers/quad_sink.h" | 9 #include "cc/layers/quad_sink.h" |
10 #include "cc/quads/texture_draw_quad.h" | 10 #include "cc/quads/texture_draw_quad.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 y / total_height, | 48 y / total_height, |
49 width / total_width, | 49 width / total_width, |
50 height / total_height); | 50 height / total_height); |
51 } | 51 } |
52 | 52 |
53 void NinePatchLayerImpl::SetLayout(gfx::Size image_bounds, gfx::Rect aperture) { | 53 void NinePatchLayerImpl::SetLayout(gfx::Size image_bounds, gfx::Rect aperture) { |
54 image_bounds_ = image_bounds; | 54 image_bounds_ = image_bounds; |
55 image_aperture_ = aperture; | 55 image_aperture_ = aperture; |
56 } | 56 } |
57 | 57 |
| 58 bool NinePatchLayerImpl::WillDraw(DrawMode draw_mode, |
| 59 ResourceProvider* resource_provider) { |
| 60 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE) |
| 61 return false; |
| 62 return LayerImpl::WillDraw(draw_mode, resource_provider); |
| 63 } |
| 64 |
58 void NinePatchLayerImpl::AppendQuads(QuadSink* quad_sink, | 65 void NinePatchLayerImpl::AppendQuads(QuadSink* quad_sink, |
59 AppendQuadsData* append_quads_data) { | 66 AppendQuadsData* append_quads_data) { |
60 if (!resource_id_) | 67 if (!resource_id_) |
61 return; | 68 return; |
62 | 69 |
63 SharedQuadState* shared_quad_state = | 70 SharedQuadState* shared_quad_state = |
64 quad_sink->UseSharedQuadState(CreateSharedQuadState()); | 71 quad_sink->UseSharedQuadState(CreateSharedQuadState()); |
65 AppendDebugBorderQuad(quad_sink, shared_quad_state, append_quads_data); | 72 AppendDebugBorderQuad(quad_sink, shared_quad_state, append_quads_data); |
66 | 73 |
67 static const bool flipped = false; | 74 static const bool flipped = false; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 297 |
291 list = new base::ListValue; | 298 list = new base::ListValue; |
292 list->AppendInteger(image_bounds_.width()); | 299 list->AppendInteger(image_bounds_.width()); |
293 list->AppendInteger(image_bounds_.height()); | 300 list->AppendInteger(image_bounds_.height()); |
294 result->Set("ImageBounds", list); | 301 result->Set("ImageBounds", list); |
295 | 302 |
296 return result; | 303 return result; |
297 } | 304 } |
298 | 305 |
299 } // namespace cc | 306 } // namespace cc |
OLD | NEW |