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

Unified Diff: cc/nine_patch_layer_impl_unittest.cc

Issue 11783094: cc: Add point-based UV coordinate on TextureLayer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed unittest and abreviations Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: cc/nine_patch_layer_impl_unittest.cc
diff --git a/cc/nine_patch_layer_impl_unittest.cc b/cc/nine_patch_layer_impl_unittest.cc
index aa9bc01bb4fbbdecfb6b8d38ff979c2eafcc40a5..69e16c26669794d7dbb8e409acf3b4830753d0fc 100644
--- a/cc/nine_patch_layer_impl_unittest.cc
+++ b/cc/nine_patch_layer_impl_unittest.cc
@@ -82,7 +82,9 @@ TEST(NinePatchLayerImplTest, verifyDrawQuads)
for (size_t i = 0; i < quads.size(); ++i) {
DrawQuad* quad = quads[i];
const TextureDrawQuad* texQuad = TextureDrawQuad::MaterialCast(quad);
- gfx::RectF texRect = texQuad->uv_rect;
+ gfx::SizeF uvSize(texQuad->uv_bottom_right.x() - texQuad->uv_top_left.x(),
+ texQuad->uv_bottom_right.y() - texQuad->uv_top_left.y());
+ gfx::RectF texRect(texQuad->uv_top_left, uvSize);
danakj 2013/01/11 02:21:51 you can use this from rect_f.h UI_EXPORT RectF Bo
Jerome 2013/01/11 18:00:01 Done.
texRect.Scale(bitmapSize.width(), bitmapSize.height());
texRemaining.Subtract(Region(ToRoundedIntRect(texRect)));
}
@@ -135,7 +137,9 @@ TEST(NinePatchLayerImplTest, verifyDrawQuadsForSqueezedLayer)
for (size_t i = 0; i < quads.size(); ++i) {
DrawQuad* quad = quads[i];
const TextureDrawQuad* texQuad = TextureDrawQuad::MaterialCast(quad);
- gfx::RectF texRect = texQuad->uv_rect;
+ gfx::SizeF uvSize(texQuad->uv_bottom_right.x() - texQuad->uv_top_left.x(),
+ texQuad->uv_bottom_right.y() - texQuad->uv_top_left.y());
+ gfx::RectF texRect(texQuad->uv_top_left, uvSize);
danakj 2013/01/11 02:21:51 same here
Jerome 2013/01/11 18:00:01 Done.
texRect.Scale(bitmapSize.width(), bitmapSize.height());
texRemaining.Subtract(Region(ToRoundedIntRect(texRect)));
}
« no previous file with comments | « cc/nine_patch_layer_impl.cc ('k') | cc/scrollbar_layer_impl.cc » ('j') | cc/software_renderer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698