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

Unified Diff: cc/content_layer_unittest.cc

Issue 11266030: Use gfx:: Geometry types for the resource provider and layer updater classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: uint8 Created 8 years, 2 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
« no previous file with comments | « cc/content_layer_client.h ('k') | cc/content_layer_updater.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/content_layer_unittest.cc
diff --git a/cc/content_layer_unittest.cc b/cc/content_layer_unittest.cc
index 3287aeb4918bfe8a28dec2263197029d97c57035..8eb99605cae87708c07e6cc59136642db876d2a8 100644
--- a/cc/content_layer_unittest.cc
+++ b/cc/content_layer_unittest.cc
@@ -12,6 +12,7 @@
#include "cc/test/geometry_test_utils.h"
#include "skia/ext/platform_canvas.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gfx/rect_conversions.h"
#include <public/WebFloatRect.h>
#include <public/WebRect.h>
@@ -22,35 +23,34 @@ namespace {
class MockContentLayerClient : public ContentLayerClient {
public:
- explicit MockContentLayerClient(IntRect opaqueLayerRect)
+ explicit MockContentLayerClient(gfx::Rect opaqueLayerRect)
: m_opaqueLayerRect(opaqueLayerRect)
{
}
- virtual void paintContents(SkCanvas*, const IntRect&, FloatRect& opaque) OVERRIDE
+ virtual void paintContents(SkCanvas*, const gfx::Rect&, gfx::RectF& opaque) OVERRIDE
{
- opaque = FloatRect(m_opaqueLayerRect);
+ opaque = gfx::RectF(m_opaqueLayerRect);
}
private:
- IntRect m_opaqueLayerRect;
+ gfx::Rect m_opaqueLayerRect;
};
TEST(ContentLayerTest, ContentLayerPainterWithDeviceScale)
{
float contentsScale = 2;
- IntRect contentRect(10, 10, 100, 100);
- IntRect opaqueRectInLayerSpace(5, 5, 20, 20);
- IntRect opaqueRectInContentSpace = opaqueRectInLayerSpace;
- opaqueRectInContentSpace.scale(contentsScale);
+ gfx::Rect contentRect(10, 10, 100, 100);
+ gfx::Rect opaqueRectInLayerSpace(5, 5, 20, 20);
+ gfx::RectF opaqueRectInContentSpace = gfx::ScaleRect(opaqueRectInLayerSpace, contentsScale, contentsScale);
MockContentLayerClient client(opaqueRectInLayerSpace);
scoped_refptr<BitmapContentLayerUpdater> updater = BitmapContentLayerUpdater::create(ContentLayerPainter::create(&client).PassAs<LayerPainter>());
- IntRect resultingOpaqueRect;
+ gfx::Rect resultingOpaqueRect;
RenderingStats stats;
- updater->prepareToUpdate(contentRect, IntSize(256, 256), contentsScale, contentsScale, resultingOpaqueRect, stats);
+ updater->prepareToUpdate(contentRect, gfx::Size(256, 256), contentsScale, contentsScale, resultingOpaqueRect, stats);
- EXPECT_RECT_EQ(opaqueRectInContentSpace, resultingOpaqueRect);
+ EXPECT_RECT_EQ(gfx::ToEnclosingRect(opaqueRectInContentSpace), resultingOpaqueRect);
}
} // namespace
« no previous file with comments | « cc/content_layer_client.h ('k') | cc/content_layer_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698