| 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/nine_patch_layer_impl.h" | 5 #include "cc/nine_patch_layer_impl.h" |
| 6 | 6 |
| 7 #include "cc/append_quads_data.h" | 7 #include "cc/append_quads_data.h" |
| 8 #include "cc/single_thread_proxy.h" | 8 #include "cc/single_thread_proxy.h" |
| 9 #include "cc/test/geometry_test_utils.h" | 9 #include "cc/test/geometry_test_utils.h" |
| 10 #include "cc/test/layer_test_common.h" | 10 #include "cc/test/layer_test_common.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } | 68 } |
| 69 EXPECT_RECT_EQ(remaining.bounds(), scaledApertureNonUniform); | 69 EXPECT_RECT_EQ(remaining.bounds(), scaledApertureNonUniform); |
| 70 Region scaledApertureRegion(scaledApertureNonUniform); | 70 Region scaledApertureRegion(scaledApertureNonUniform); |
| 71 EXPECT_EQ(remaining, scaledApertureRegion); | 71 EXPECT_EQ(remaining, scaledApertureRegion); |
| 72 | 72 |
| 73 // Verify UV rects | 73 // Verify UV rects |
| 74 gfx::Rect bitmapRect(gfx::Point(), bitmapSize); | 74 gfx::Rect bitmapRect(gfx::Point(), bitmapSize); |
| 75 Region texRemaining(bitmapRect); | 75 Region texRemaining(bitmapRect); |
| 76 for (size_t i = 0; i < quads.size(); ++i) { | 76 for (size_t i = 0; i < quads.size(); ++i) { |
| 77 DrawQuad* quad = quads[i]; | 77 DrawQuad* quad = quads[i]; |
| 78 const TextureDrawQuad* texQuad = TextureDrawQuad::materialCast(quad); | 78 const TextureDrawQuad* texQuad = TextureDrawQuad::MaterialCast(quad); |
| 79 gfx::RectF texRect = texQuad->uvRect(); | 79 gfx::RectF texRect = texQuad->uv_rect; |
| 80 texRect.Scale(bitmapSize.width(), bitmapSize.height()); | 80 texRect.Scale(bitmapSize.width(), bitmapSize.height()); |
| 81 texRemaining.Subtract(Region(ToRoundedIntRect(texRect))); | 81 texRemaining.Subtract(Region(ToRoundedIntRect(texRect))); |
| 82 } | 82 } |
| 83 EXPECT_RECT_EQ(texRemaining.bounds(), apertureRect); | 83 EXPECT_RECT_EQ(texRemaining.bounds(), apertureRect); |
| 84 Region apertureRegion(apertureRect); | 84 Region apertureRegion(apertureRect); |
| 85 EXPECT_EQ(texRemaining, apertureRegion); | 85 EXPECT_EQ(texRemaining, apertureRegion); |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace | 88 } // namespace |
| 89 } // namespace cc | 89 } // namespace cc |
| OLD | NEW |