1// Copyright (c) 2013 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#include "base/basictypes.h" 6#include "testing/gtest/include/gtest/gtest.h" 7#include "ui/gfx/geometry/rect.h" 8#include "ui/gfx/skia_util.h" 9 10namespace gfx { 11 12TEST(RectTest, SkiaRectConversions) { 13 Rect isrc(10, 20, 30, 40); 14 RectF fsrc(10.5f, 20.5f, 30.5f, 40.5f); 15 16 SkIRect skirect = RectToSkIRect(isrc); 17 EXPECT_EQ(isrc.ToString(), SkIRectToRect(skirect).ToString()); 18 19 SkRect skrect = RectToSkRect(isrc); 20 EXPECT_EQ(gfx::RectF(isrc).ToString(), SkRectToRectF(skrect).ToString()); 21 22 skrect = RectFToSkRect(fsrc); 23 EXPECT_EQ(fsrc.ToString(), SkRectToRectF(skrect).ToString()); 24} 25 26} // namespace gfx 27