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

Unified Diff: cc/layer_tree_host_impl_unittest.cc

Issue 11264056: cc: Use gfx:: Geometry types for positions, bounds, and related things. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ScaleAsVector Created 8 years, 1 month 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/layer_tree_host_impl.cc ('k') | cc/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_impl_unittest.cc
diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc
index 79bc89655efcce486430526654a42d505227f97d..fc4d1dd1258f9d582587e21325854a22aaf2c212 100644
--- a/cc/layer_tree_host_impl_unittest.cc
+++ b/cc/layer_tree_host_impl_unittest.cc
@@ -39,6 +39,7 @@
#include "media/base/video_frame.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gfx/size_conversions.h"
#include <public/WebVideoFrame.h>
#include <public/WebVideoFrameProvider.h>
@@ -74,11 +75,11 @@ public:
{
Settings::setPageScalePinchZoomEnabled(GetParam());
LayerTreeSettings settings;
- settings.minimumOcclusionTrackingSize = IntSize();
+ settings.minimumOcclusionTrackingSize = gfx::Size();
m_hostImpl = LayerTreeHostImpl::create(settings, this);
m_hostImpl->initializeRenderer(createContext());
- m_hostImpl->setViewportSize(IntSize(10, 10), IntSize(10, 10));
+ m_hostImpl->setViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
}
virtual void TearDown()
@@ -102,18 +103,18 @@ public:
Settings::setPartialSwapEnabled(partialSwap);
LayerTreeSettings settings;
- settings.minimumOcclusionTrackingSize = IntSize();
+ settings.minimumOcclusionTrackingSize = gfx::Size();
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
myHostImpl->initializeRenderer(graphicsContext.Pass());
- myHostImpl->setViewportSize(IntSize(10, 10), IntSize(10, 10));
+ myHostImpl->setViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setPosition(FloatPoint(0, 0));
- root->setBounds(IntSize(10, 10));
- root->setContentBounds(IntSize(10, 10));
- root->setVisibleContentRect(IntRect(0, 0, 10, 10));
+ root->setAnchorPoint(gfx::PointF(0, 0));
+ root->setPosition(gfx::PointF(0, 0));
+ root->setBounds(gfx::Size(10, 10));
+ root->setContentBounds(gfx::Size(10, 10));
+ root->setVisibleContentRect(gfx::Rect(0, 0, 10, 10));
root->setDrawsContent(true);
myHostImpl->setRootLayer(root.Pass());
return myHostImpl.Pass();
@@ -141,28 +142,28 @@ public:
ASSERT_EQ(timesEncountered, 1);
}
- void setupScrollAndContentsLayers(const IntSize& contentSize)
+ void setupScrollAndContentsLayers(const gfx::Size& contentSize)
{
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
root->setScrollable(true);
root->setScrollPosition(IntPoint(0, 0));
- root->setMaxScrollPosition(contentSize);
+ root->setMaxScrollPosition(cc::IntSize(contentSize));
root->setBounds(contentSize);
root->setContentBounds(contentSize);
- root->setPosition(FloatPoint(0, 0));
- root->setAnchorPoint(FloatPoint(0, 0));
+ root->setPosition(gfx::PointF(0, 0));
+ root->setAnchorPoint(gfx::PointF(0, 0));
scoped_ptr<LayerImpl> contents = LayerImpl::create(2);
contents->setDrawsContent(true);
contents->setBounds(contentSize);
contents->setContentBounds(contentSize);
- contents->setPosition(FloatPoint(0, 0));
- contents->setAnchorPoint(FloatPoint(0, 0));
+ contents->setPosition(gfx::PointF(0, 0));
+ contents->setAnchorPoint(gfx::PointF(0, 0));
root->addChild(contents.Pass());
m_hostImpl->setRootLayer(root.Pass());
}
- static scoped_ptr<LayerImpl> createScrollableLayer(int id, const IntSize& size)
+ static scoped_ptr<LayerImpl> createScrollableLayer(int id, const gfx::Size& size)
{
scoped_ptr<LayerImpl> layer = LayerImpl::create(id);
layer->setScrollable(true);
@@ -212,7 +213,7 @@ TEST_P(LayerTreeHostImplTest, notifyIfCanDrawChanged)
EXPECT_FALSE(m_hostImpl->canDraw());
m_onCanDrawStateChangedCalled = false;
- setupScrollAndContentsLayers(IntSize(100, 100));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
EXPECT_TRUE(m_hostImpl->canDraw());
EXPECT_TRUE(m_onCanDrawStateChangedCalled);
m_onCanDrawStateChangedCalled = false;
@@ -223,18 +224,18 @@ TEST_P(LayerTreeHostImplTest, notifyIfCanDrawChanged)
EXPECT_TRUE(m_onCanDrawStateChangedCalled);
m_onCanDrawStateChangedCalled = false;
- setupScrollAndContentsLayers(IntSize(100, 100));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
EXPECT_TRUE(m_hostImpl->canDraw());
EXPECT_TRUE(m_onCanDrawStateChangedCalled);
m_onCanDrawStateChangedCalled = false;
// Toggle the device viewport size to make sure it toggles canDraw.
- m_hostImpl->setViewportSize(IntSize(100, 100), IntSize(0, 0));
+ m_hostImpl->setViewportSize(gfx::Size(100, 100), gfx::Size(0, 0));
EXPECT_FALSE(m_hostImpl->canDraw());
EXPECT_TRUE(m_onCanDrawStateChangedCalled);
m_onCanDrawStateChangedCalled = false;
- m_hostImpl->setViewportSize(IntSize(100, 100), IntSize(100, 100));
+ m_hostImpl->setViewportSize(gfx::Size(100, 100), gfx::Size(100, 100));
EXPECT_TRUE(m_hostImpl->canDraw());
EXPECT_TRUE(m_onCanDrawStateChangedCalled);
m_onCanDrawStateChangedCalled = false;
@@ -331,8 +332,8 @@ TEST_P(LayerTreeHostImplTest, scrollDeltaRepeatedScrolls)
TEST_P(LayerTreeHostImplTest, scrollRootCallsCommitAndRedraw)
{
- setupScrollAndContentsLayers(IntSize(100, 100));
- m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
+ m_hostImpl->setViewportSize(gfx::Size(50, 50), gfx::Size(50, 50));
initializeRendererAndDrawFrame();
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), InputHandlerClient::Wheel), InputHandlerClient::ScrollStarted);
@@ -355,9 +356,9 @@ TEST_P(LayerTreeHostImplTest, scrollWithoutRenderer)
// Initialization will fail here.
m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new FakeWebGraphicsContext3DMakeCurrentFails)).PassAs<GraphicsContext>());
- m_hostImpl->setViewportSize(IntSize(10, 10), IntSize(10, 10));
+ m_hostImpl->setViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
- setupScrollAndContentsLayers(IntSize(100, 100));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
// We should not crash when trying to scroll after the renderer initialization fails.
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), InputHandlerClient::Wheel), InputHandlerClient::ScrollIgnored);
@@ -367,15 +368,15 @@ TEST_P(LayerTreeHostImplTest, replaceTreeWhileScrolling)
{
const int scrollLayerId = 1;
- setupScrollAndContentsLayers(IntSize(100, 100));
- m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
+ m_hostImpl->setViewportSize(gfx::Size(50, 50), gfx::Size(50, 50));
initializeRendererAndDrawFrame();
// We should not crash if the tree is replaced while we are scrolling.
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), InputHandlerClient::Wheel), InputHandlerClient::ScrollStarted);
m_hostImpl->detachLayerTree();
- setupScrollAndContentsLayers(IntSize(100, 100));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
// We should still be scrolling, because the scrolled layer also exists in the new tree.
IntSize scrollDelta(0, 10);
@@ -387,8 +388,8 @@ TEST_P(LayerTreeHostImplTest, replaceTreeWhileScrolling)
TEST_P(LayerTreeHostImplTest, clearRootRenderSurfaceAndScroll)
{
- setupScrollAndContentsLayers(IntSize(100, 100));
- m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
+ m_hostImpl->setViewportSize(gfx::Size(50, 50), gfx::Size(50, 50));
initializeRendererAndDrawFrame();
// We should be able to scroll even if the root layer loses its render surface after the most
@@ -399,8 +400,8 @@ TEST_P(LayerTreeHostImplTest, clearRootRenderSurfaceAndScroll)
TEST_P(LayerTreeHostImplTest, wheelEventHandlers)
{
- setupScrollAndContentsLayers(IntSize(100, 100));
- m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
+ m_hostImpl->setViewportSize(gfx::Size(50, 50), gfx::Size(50, 50));
initializeRendererAndDrawFrame();
LayerImpl* root = m_hostImpl->rootLayer();
@@ -415,8 +416,8 @@ TEST_P(LayerTreeHostImplTest, wheelEventHandlers)
TEST_P(LayerTreeHostImplTest, shouldScrollOnMainThread)
{
- setupScrollAndContentsLayers(IntSize(100, 100));
- m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
+ m_hostImpl->setViewportSize(gfx::Size(50, 50), gfx::Size(50, 50));
initializeRendererAndDrawFrame();
LayerImpl* root = m_hostImpl->rootLayer();
@@ -428,8 +429,8 @@ TEST_P(LayerTreeHostImplTest, shouldScrollOnMainThread)
TEST_P(LayerTreeHostImplTest, nonFastScrollableRegionBasic)
{
- setupScrollAndContentsLayers(IntSize(200, 200));
- m_hostImpl->setViewportSize(IntSize(100, 100), IntSize(100, 100));
+ setupScrollAndContentsLayers(gfx::Size(200, 200));
+ m_hostImpl->setViewportSize(gfx::Size(100, 100), gfx::Size(100, 100));
initializeRendererAndDrawFrame();
LayerImpl* root = m_hostImpl->rootLayer();
@@ -450,12 +451,12 @@ TEST_P(LayerTreeHostImplTest, nonFastScrollableRegionBasic)
TEST_P(LayerTreeHostImplTest, nonFastScrollableRegionWithOffset)
{
- setupScrollAndContentsLayers(IntSize(200, 200));
- m_hostImpl->setViewportSize(IntSize(100, 100), IntSize(100, 100));
+ setupScrollAndContentsLayers(gfx::Size(200, 200));
+ m_hostImpl->setViewportSize(gfx::Size(100, 100), gfx::Size(100, 100));
LayerImpl* root = m_hostImpl->rootLayer();
root->setNonFastScrollableRegion(IntRect(0, 0, 50, 50));
- root->setPosition(FloatPoint(-25, 0));
+ root->setPosition(gfx::PointF(-25, 0));
initializeRendererAndDrawFrame();
// This point would fall into the non-fast scrollable region except that we've moved the layer down by 25 pixels.
@@ -469,12 +470,11 @@ TEST_P(LayerTreeHostImplTest, nonFastScrollableRegionWithOffset)
TEST_P(LayerTreeHostImplTest, maxScrollPositionChangedByDeviceScaleFactor)
{
- setupScrollAndContentsLayers(IntSize(100, 100));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
float deviceScaleFactor = 2;
- IntSize layoutViewport(25, 25);
- IntSize deviceViewport(layoutViewport);
- deviceViewport.scale(deviceScaleFactor);
+ gfx::Size layoutViewport(25, 25);
+ gfx::Size deviceViewport(gfx::ToFlooredSize(layoutViewport.Scale(deviceScaleFactor)));
m_hostImpl->setViewportSize(layoutViewport, deviceViewport);
m_hostImpl->setDeviceScaleFactor(deviceScaleFactor);
EXPECT_EQ(m_hostImpl->rootLayer()->maxScrollPosition(), IntSize(25, 25));
@@ -491,8 +491,8 @@ TEST_P(LayerTreeHostImplTest, implPinchZoom)
if (!Settings::pageScalePinchZoomEnabled())
return;
- setupScrollAndContentsLayers(IntSize(100, 100));
- m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
+ m_hostImpl->setViewportSize(gfx::Size(50, 50), gfx::Size(50, 50));
initializeRendererAndDrawFrame();
LayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
@@ -544,8 +544,8 @@ TEST_P(LayerTreeHostImplTest, implPinchZoom)
TEST_P(LayerTreeHostImplTest, pinchGesture)
{
- setupScrollAndContentsLayers(IntSize(100, 100));
- m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
+ m_hostImpl->setViewportSize(gfx::Size(50, 50), gfx::Size(50, 50));
initializeRendererAndDrawFrame();
LayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
@@ -631,8 +631,8 @@ TEST_P(LayerTreeHostImplTest, pinchGesture)
TEST_P(LayerTreeHostImplTest, pageScaleAnimation)
{
- setupScrollAndContentsLayers(IntSize(100, 100));
- m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
+ m_hostImpl->setViewportSize(gfx::Size(50, 50), gfx::Size(50, 50));
initializeRendererAndDrawFrame();
LayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
@@ -683,8 +683,8 @@ TEST_P(LayerTreeHostImplTest, pageScaleAnimation)
TEST_P(LayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhilePinchZooming)
{
- setupScrollAndContentsLayers(IntSize(100, 100));
- m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
+ m_hostImpl->setViewportSize(gfx::Size(50, 50), gfx::Size(50, 50));
initializeRendererAndDrawFrame();
LayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
@@ -752,8 +752,8 @@ TEST_P(LayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhilePinchZooming)
TEST_P(LayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhileAnimatingPageScale)
{
- setupScrollAndContentsLayers(IntSize(100, 100));
- m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
+ m_hostImpl->setViewportSize(gfx::Size(50, 50), gfx::Size(50, 50));
initializeRendererAndDrawFrame();
LayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
@@ -826,14 +826,14 @@ protected:
, m_didDrawCalled(false)
, m_willDrawCalled(false)
{
- setAnchorPoint(FloatPoint(0, 0));
- setBounds(IntSize(10, 10));
- setContentBounds(IntSize(10, 10));
+ setAnchorPoint(gfx::PointF(0, 0));
+ setBounds(gfx::Size(10, 10));
+ setContentBounds(gfx::Size(10, 10));
setDrawsContent(true);
setSkipsDraw(false);
- setVisibleContentRect(IntRect(0, 0, 10, 10));
+ setVisibleContentRect(gfx::Rect(0, 0, 10, 10));
- scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(IntSize(100, 100), LayerTilingData::HasBorderTexels);
+ scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(gfx::Size(100, 100), LayerTilingData::HasBorderTexels);
tiler->setBounds(contentBounds());
setTilingData(*tiler.get());
}
@@ -854,9 +854,9 @@ TEST_P(LayerTreeHostImplTest, didDrawNotCalledOnHiddenLayer)
root->addChild(DidDrawCheckLayer::create(2));
DidDrawCheckLayer* layer = static_cast<DidDrawCheckLayer*>(root->children()[0]);
// Ensure visibleContentRect for layer is empty
- layer->setPosition(FloatPoint(100, 100));
- layer->setBounds(IntSize(10, 10));
- layer->setContentBounds(IntSize(10, 10));
+ layer->setPosition(gfx::PointF(100, 100));
+ layer->setBounds(gfx::Size(10, 10));
+ layer->setContentBounds(gfx::Size(10, 10));
LayerTreeHostImpl::FrameData frame;
@@ -870,10 +870,10 @@ TEST_P(LayerTreeHostImplTest, didDrawNotCalledOnHiddenLayer)
EXPECT_FALSE(layer->willDrawCalled());
EXPECT_FALSE(layer->didDrawCalled());
- EXPECT_TRUE(layer->visibleContentRect().isEmpty());
+ EXPECT_TRUE(layer->visibleContentRect().IsEmpty());
// Ensure visibleContentRect for layer layer is not empty
- layer->setPosition(FloatPoint(0, 0));
+ layer->setPosition(gfx::PointF(0, 0));
EXPECT_FALSE(layer->willDrawCalled());
EXPECT_FALSE(layer->didDrawCalled());
@@ -885,12 +885,12 @@ TEST_P(LayerTreeHostImplTest, didDrawNotCalledOnHiddenLayer)
EXPECT_TRUE(layer->willDrawCalled());
EXPECT_TRUE(layer->didDrawCalled());
- EXPECT_FALSE(layer->visibleContentRect().isEmpty());
+ EXPECT_FALSE(layer->visibleContentRect().IsEmpty());
}
TEST_P(LayerTreeHostImplTest, willDrawNotCalledOnOccludedLayer)
{
- IntSize bigSize(1000, 1000);
+ gfx::Size bigSize(1000, 1000);
m_hostImpl->setViewportSize(bigSize, bigSize);
m_hostImpl->setRootLayer(DidDrawCheckLayer::create(1));
@@ -965,13 +965,13 @@ private:
explicit MissingTextureAnimatingLayer(int id, bool tileMissing, bool skipsDraw, bool animating, ResourceProvider* resourceProvider)
: DidDrawCheckLayer(id)
{
- scoped_ptr<LayerTilingData> tilingData = LayerTilingData::create(IntSize(10, 10), LayerTilingData::NoBorderTexels);
+ scoped_ptr<LayerTilingData> tilingData = LayerTilingData::create(gfx::Size(10, 10), LayerTilingData::NoBorderTexels);
tilingData->setBounds(bounds());
setTilingData(*tilingData.get());
setSkipsDraw(skipsDraw);
if (!tileMissing) {
- ResourceProvider::ResourceId resource = resourceProvider->createResource(Renderer::ContentPool, IntSize(), GL_RGBA, ResourceProvider::TextureUsageAny);
- pushTileProperties(0, 0, resource, IntRect(), false);
+ ResourceProvider::ResourceId resource = resourceProvider->createResource(Renderer::ContentPool, gfx::Size(), GL_RGBA, ResourceProvider::TextureUsageAny);
+ pushTileProperties(0, 0, resource, gfx::Rect(), false);
}
if (animating)
addAnimatedTransformToLayer(*this, 10, 3, 0);
@@ -1036,24 +1036,24 @@ TEST_P(LayerTreeHostImplTest, scrollNonCompositedRoot)
{
// Test the configuration where a non-composited root layer is embedded in a
// scrollable outer layer.
- IntSize surfaceSize(10, 10);
+ gfx::Size surfaceSize(10, 10);
scoped_ptr<LayerImpl> contentLayer = LayerImpl::create(1);
contentLayer->setUseLCDText(true);
contentLayer->setDrawsContent(true);
- contentLayer->setPosition(FloatPoint(0, 0));
- contentLayer->setAnchorPoint(FloatPoint(0, 0));
+ contentLayer->setPosition(gfx::PointF(0, 0));
+ contentLayer->setAnchorPoint(gfx::PointF(0, 0));
contentLayer->setBounds(surfaceSize);
- contentLayer->setContentBounds(IntSize(surfaceSize.width() * 2, surfaceSize.height() * 2));
+ contentLayer->setContentBounds(gfx::Size(surfaceSize.width() * 2, surfaceSize.height() * 2));
contentLayer->setContentsScale(2, 2);
scoped_ptr<LayerImpl> scrollLayer = LayerImpl::create(2);
scrollLayer->setScrollable(true);
- scrollLayer->setMaxScrollPosition(surfaceSize);
+ scrollLayer->setMaxScrollPosition(cc::IntSize(surfaceSize));
scrollLayer->setBounds(surfaceSize);
scrollLayer->setContentBounds(surfaceSize);
- scrollLayer->setPosition(FloatPoint(0, 0));
- scrollLayer->setAnchorPoint(FloatPoint(0, 0));
+ scrollLayer->setPosition(gfx::PointF(0, 0));
+ scrollLayer->setAnchorPoint(gfx::PointF(0, 0));
scrollLayer->addChild(contentLayer.Pass());
m_hostImpl->setRootLayer(scrollLayer.Pass());
@@ -1069,7 +1069,7 @@ TEST_P(LayerTreeHostImplTest, scrollNonCompositedRoot)
TEST_P(LayerTreeHostImplTest, scrollChildCallsCommitAndRedraw)
{
- IntSize surfaceSize(10, 10);
+ gfx::Size surfaceSize(10, 10);
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
root->setBounds(surfaceSize);
root->setContentBounds(surfaceSize);
@@ -1087,7 +1087,7 @@ TEST_P(LayerTreeHostImplTest, scrollChildCallsCommitAndRedraw)
TEST_P(LayerTreeHostImplTest, scrollMissesChild)
{
- IntSize surfaceSize(10, 10);
+ gfx::Size surfaceSize(10, 10);
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
root->addChild(createScrollableLayer(2, surfaceSize));
m_hostImpl->setRootLayer(root.Pass());
@@ -1102,7 +1102,7 @@ TEST_P(LayerTreeHostImplTest, scrollMissesChild)
TEST_P(LayerTreeHostImplTest, scrollMissesBackfacingChild)
{
- IntSize surfaceSize(10, 10);
+ gfx::Size surfaceSize(10, 10);
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
scoped_ptr<LayerImpl> child = createScrollableLayer(2, surfaceSize);
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
@@ -1125,7 +1125,7 @@ TEST_P(LayerTreeHostImplTest, scrollMissesBackfacingChild)
TEST_P(LayerTreeHostImplTest, scrollBlockedByContentLayer)
{
- IntSize surfaceSize(10, 10);
+ gfx::Size surfaceSize(10, 10);
scoped_ptr<LayerImpl> contentLayer = createScrollableLayer(1, surfaceSize);
contentLayer->setShouldScrollOnMainThread(true);
contentLayer->setScrollable(false);
@@ -1143,7 +1143,7 @@ TEST_P(LayerTreeHostImplTest, scrollBlockedByContentLayer)
TEST_P(LayerTreeHostImplTest, scrollRootAndChangePageScaleOnMainThread)
{
- IntSize surfaceSize(10, 10);
+ gfx::Size surfaceSize(10, 10);
float pageScale = 2;
scoped_ptr<LayerImpl> root = createScrollableLayer(1, surfaceSize);
m_hostImpl->setRootLayer(root.Pass());
@@ -1176,7 +1176,7 @@ TEST_P(LayerTreeHostImplTest, scrollRootAndChangePageScaleOnMainThread)
TEST_P(LayerTreeHostImplTest, scrollRootAndChangePageScaleOnImplThread)
{
- IntSize surfaceSize(10, 10);
+ gfx::Size surfaceSize(10, 10);
float pageScale = 2;
scoped_ptr<LayerImpl> root = createScrollableLayer(1, surfaceSize);
m_hostImpl->setRootLayer(root.Pass());
@@ -1212,7 +1212,7 @@ TEST_P(LayerTreeHostImplTest, scrollRootAndChangePageScaleOnImplThread)
TEST_P(LayerTreeHostImplTest, pageScaleDeltaAppliedToRootScrollLayerOnly)
{
- IntSize surfaceSize(10, 10);
+ gfx::Size surfaceSize(10, 10);
float defaultPageScale = 1;
WebTransformationMatrix defaultPageScaleMatrix;
@@ -1257,7 +1257,7 @@ TEST_P(LayerTreeHostImplTest, pageScaleDeltaAppliedToRootScrollLayerOnly)
TEST_P(LayerTreeHostImplTest, scrollChildAndChangePageScaleOnMainThread)
{
- IntSize surfaceSize(10, 10);
+ gfx::Size surfaceSize(10, 10);
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
root->setBounds(surfaceSize);
root->setContentBounds(surfaceSize);
@@ -1303,7 +1303,7 @@ TEST_P(LayerTreeHostImplTest, scrollChildBeyondLimit)
// Scroll a child layer beyond its maximum scroll range and make sure the
// parent layer is scrolled on the axis on which the child was unable to
// scroll.
- IntSize surfaceSize(10, 10);
+ gfx::Size surfaceSize(10, 10);
scoped_ptr<LayerImpl> root = createScrollableLayer(1, surfaceSize);
scoped_ptr<LayerImpl> grandChild = createScrollableLayer(3, surfaceSize);
@@ -1339,7 +1339,7 @@ TEST_P(LayerTreeHostImplTest, scrollEventBubbling)
{
// When we try to scroll a non-scrollable child layer, the scroll delta
// should be applied to one of its ancestors if possible.
- IntSize surfaceSize(10, 10);
+ gfx::Size surfaceSize(10, 10);
scoped_ptr<LayerImpl> root = createScrollableLayer(1, surfaceSize);
scoped_ptr<LayerImpl> child = createScrollableLayer(2, surfaceSize);
@@ -1365,7 +1365,7 @@ TEST_P(LayerTreeHostImplTest, scrollEventBubbling)
TEST_P(LayerTreeHostImplTest, scrollBeforeRedraw)
{
- IntSize surfaceSize(10, 10);
+ gfx::Size surfaceSize(10, 10);
m_hostImpl->setRootLayer(createScrollableLayer(1, surfaceSize));
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
@@ -1380,14 +1380,14 @@ TEST_P(LayerTreeHostImplTest, scrollBeforeRedraw)
TEST_P(LayerTreeHostImplTest, scrollAxisAlignedRotatedLayer)
{
- setupScrollAndContentsLayers(IntSize(100, 100));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
// Rotate the root layer 90 degrees counter-clockwise about its center.
WebTransformationMatrix rotateTransform;
rotateTransform.rotate(-90);
m_hostImpl->rootLayer()->setTransform(rotateTransform);
- IntSize surfaceSize(50, 50);
+ gfx::Size surfaceSize(50, 50);
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
@@ -1415,7 +1415,7 @@ TEST_P(LayerTreeHostImplTest, scrollAxisAlignedRotatedLayer)
TEST_P(LayerTreeHostImplTest, scrollNonAxisAlignedRotatedLayer)
{
- setupScrollAndContentsLayers(IntSize(100, 100));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
int childLayerId = 3;
float childLayerAngle = -20;
@@ -1431,7 +1431,7 @@ TEST_P(LayerTreeHostImplTest, scrollNonAxisAlignedRotatedLayer)
child->setMaxScrollPosition(IntSize(0, child->contentBounds().height()));
m_hostImpl->rootLayer()->addChild(child.Pass());
- IntSize surfaceSize(50, 50);
+ gfx::Size surfaceSize(50, 50);
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
@@ -1476,7 +1476,7 @@ TEST_P(LayerTreeHostImplTest, scrollNonAxisAlignedRotatedLayer)
TEST_P(LayerTreeHostImplTest, scrollScaledLayer)
{
- setupScrollAndContentsLayers(IntSize(100, 100));
+ setupScrollAndContentsLayers(gfx::Size(100, 100));
// Scale the layer to twice its normal size.
int scale = 2;
@@ -1484,7 +1484,7 @@ TEST_P(LayerTreeHostImplTest, scrollScaledLayer)
scaleTransform.scale(scale);
m_hostImpl->rootLayer()->setTransform(scaleTransform);
- IntSize surfaceSize(50, 50);
+ gfx::Size surfaceSize(50, 50);
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
@@ -1540,14 +1540,14 @@ public:
{
m_quadsAppended = true;
- IntRect opaqueRect;
+ gfx::Rect opaqueRect;
if (contentsOpaque())
opaqueRect = m_quadRect;
else
opaqueRect = m_opaqueContentRect;
SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQuadState());
- scoped_ptr<TileDrawQuad> testBlendingDrawQuad = TileDrawQuad::create(sharedQuadState, m_quadRect, opaqueRect, m_resourceId, IntPoint(), IntSize(1, 1), 0, false, false, false, false, false);
+ scoped_ptr<TileDrawQuad> testBlendingDrawQuad = TileDrawQuad::create(sharedQuadState, m_quadRect, opaqueRect, m_resourceId, gfx::Vector2d(), gfx::Size(1, 1), 0, false, false, false, false, false);
testBlendingDrawQuad->setQuadVisibleRect(m_quadVisibleRect);
EXPECT_EQ(m_blend, testBlendingDrawQuad->needsBlending());
EXPECT_EQ(m_hasRenderSurface, !!renderSurface());
@@ -1563,9 +1563,9 @@ public:
bool quadsAppended() const { return m_quadsAppended; }
- void setQuadRect(const IntRect& rect) { m_quadRect = rect; }
- void setQuadVisibleRect(const IntRect& rect) { m_quadVisibleRect = rect; }
- void setOpaqueContentRect(const IntRect& rect) { m_opaqueContentRect = rect; }
+ void setQuadRect(const gfx::Rect& rect) { m_quadRect = rect; }
+ void setQuadVisibleRect(const gfx::Rect& rect) { m_quadVisibleRect = rect; }
+ void setOpaqueContentRect(const gfx::Rect& rect) { m_opaqueContentRect = rect; }
private:
explicit BlendStateCheckLayer(int id, ResourceProvider* resourceProvider)
@@ -1575,20 +1575,20 @@ private:
, m_quadsAppended(false)
, m_quadRect(5, 5, 5, 5)
, m_quadVisibleRect(5, 5, 5, 5)
- , m_resourceId(resourceProvider->createResource(Renderer::ContentPool, IntSize(1, 1), GL_RGBA, ResourceProvider::TextureUsageAny))
+ , m_resourceId(resourceProvider->createResource(Renderer::ContentPool, gfx::Size(1, 1), GL_RGBA, ResourceProvider::TextureUsageAny))
{
- setAnchorPoint(FloatPoint(0, 0));
- setBounds(IntSize(10, 10));
- setContentBounds(IntSize(10, 10));
+ setAnchorPoint(gfx::PointF(0, 0));
+ setBounds(gfx::Size(10, 10));
+ setContentBounds(gfx::Size(10, 10));
setDrawsContent(true);
}
bool m_blend;
bool m_hasRenderSurface;
bool m_quadsAppended;
- IntRect m_quadRect;
- IntRect m_opaqueContentRect;
- IntRect m_quadVisibleRect;
+ gfx::Rect m_quadRect;
+ gfx::Rect m_opaqueContentRect;
+ gfx::Rect m_quadVisibleRect;
ResourceProvider::ResourceId m_resourceId;
};
@@ -1596,8 +1596,8 @@ TEST_P(LayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
{
{
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setBounds(IntSize(10, 10));
+ root->setAnchorPoint(gfx::PointF(0, 0));
+ root->setBounds(gfx::Size(10, 10));
root->setContentBounds(root->bounds());
root->setDrawsContent(false);
m_hostImpl->setRootLayer(root.Pass());
@@ -1606,7 +1606,7 @@ TEST_P(LayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
root->addChild(BlendStateCheckLayer::create(2, m_hostImpl->resourceProvider()));
BlendStateCheckLayer* layer1 = static_cast<BlendStateCheckLayer*>(root->children()[0]);
- layer1->setPosition(FloatPoint(2, 2));
+ layer1->setPosition(gfx::PointF(2, 2));
LayerTreeHostImpl::FrameData frame;
@@ -1646,7 +1646,7 @@ TEST_P(LayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
layer1->addChild(BlendStateCheckLayer::create(3, m_hostImpl->resourceProvider()));
BlendStateCheckLayer* layer2 = static_cast<BlendStateCheckLayer*>(layer1->children()[0]);
- layer2->setPosition(FloatPoint(4, 4));
+ layer2->setPosition(gfx::PointF(4, 4));
// 2 opaque layers, drawn without blending.
layer1->setContentsOpaque(true);
@@ -1740,9 +1740,9 @@ TEST_P(LayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
// Layer with partially opaque contents, drawn with blending.
layer1->setContentsOpaque(false);
- layer1->setQuadRect(IntRect(5, 5, 5, 5));
- layer1->setQuadVisibleRect(IntRect(5, 5, 5, 5));
- layer1->setOpaqueContentRect(IntRect(5, 5, 2, 5));
+ layer1->setQuadRect(gfx::Rect(5, 5, 5, 5));
+ layer1->setQuadVisibleRect(gfx::Rect(5, 5, 5, 5));
+ layer1->setOpaqueContentRect(gfx::Rect(5, 5, 2, 5));
layer1->setExpectation(true, false);
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
m_hostImpl->drawLayers(frame);
@@ -1751,9 +1751,9 @@ TEST_P(LayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
// Layer with partially opaque contents partially culled, drawn with blending.
layer1->setContentsOpaque(false);
- layer1->setQuadRect(IntRect(5, 5, 5, 5));
- layer1->setQuadVisibleRect(IntRect(5, 5, 5, 2));
- layer1->setOpaqueContentRect(IntRect(5, 5, 2, 5));
+ layer1->setQuadRect(gfx::Rect(5, 5, 5, 5));
+ layer1->setQuadVisibleRect(gfx::Rect(5, 5, 5, 2));
+ layer1->setOpaqueContentRect(gfx::Rect(5, 5, 2, 5));
layer1->setExpectation(true, false);
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
m_hostImpl->drawLayers(frame);
@@ -1762,9 +1762,9 @@ TEST_P(LayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
// Layer with partially opaque contents culled, drawn with blending.
layer1->setContentsOpaque(false);
- layer1->setQuadRect(IntRect(5, 5, 5, 5));
- layer1->setQuadVisibleRect(IntRect(7, 5, 3, 5));
- layer1->setOpaqueContentRect(IntRect(5, 5, 2, 5));
+ layer1->setQuadRect(gfx::Rect(5, 5, 5, 5));
+ layer1->setQuadVisibleRect(gfx::Rect(7, 5, 3, 5));
+ layer1->setOpaqueContentRect(gfx::Rect(5, 5, 2, 5));
layer1->setExpectation(true, false);
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
m_hostImpl->drawLayers(frame);
@@ -1773,9 +1773,9 @@ TEST_P(LayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
// Layer with partially opaque contents and translucent contents culled, drawn without blending.
layer1->setContentsOpaque(false);
- layer1->setQuadRect(IntRect(5, 5, 5, 5));
- layer1->setQuadVisibleRect(IntRect(5, 5, 2, 5));
- layer1->setOpaqueContentRect(IntRect(5, 5, 2, 5));
+ layer1->setQuadRect(gfx::Rect(5, 5, 5, 5));
+ layer1->setQuadVisibleRect(gfx::Rect(5, 5, 2, 5));
+ layer1->setOpaqueContentRect(gfx::Rect(5, 5, 2, 5));
layer1->setExpectation(false, false);
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
m_hostImpl->drawLayers(frame);
@@ -1789,7 +1789,7 @@ TEST_P(LayerTreeHostImplTest, viewportCovered)
m_hostImpl->initializeRenderer(createContext());
m_hostImpl->setBackgroundColor(SK_ColorGRAY);
- IntSize viewportSize(1000, 1000);
+ gfx::Size viewportSize(1000, 1000);
m_hostImpl->setViewportSize(viewportSize, viewportSize);
m_hostImpl->setRootLayer(LayerImpl::create(1));
@@ -1800,12 +1800,12 @@ TEST_P(LayerTreeHostImplTest, viewportCovered)
// No gutter rects
{
- IntRect layerRect(0, 0, 1000, 1000);
- child->setPosition(layerRect.location());
+ gfx::Rect layerRect(0, 0, 1000, 1000);
+ child->setPosition(layerRect.origin());
child->setBounds(layerRect.size());
child->setContentBounds(layerRect.size());
- child->setQuadRect(IntRect(IntPoint(), layerRect.size()));
- child->setQuadVisibleRect(IntRect(IntPoint(), layerRect.size()));
+ child->setQuadRect(gfx::Rect(gfx::Point(), layerRect.size()));
+ child->setQuadVisibleRect(gfx::Rect(gfx::Point(), layerRect.size()));
LayerTreeHostImpl::FrameData frame;
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
@@ -1817,18 +1817,18 @@ TEST_P(LayerTreeHostImplTest, viewportCovered)
EXPECT_EQ(0u, numGutterQuads);
EXPECT_EQ(1u, frame.renderPasses[0]->quadList().size());
- verifyQuadsExactlyCoverRect(frame.renderPasses[0]->quadList(), IntRect(IntPoint::zero(), viewportSize));
+ verifyQuadsExactlyCoverRect(frame.renderPasses[0]->quadList(), gfx::Rect(gfx::Point(), viewportSize));
m_hostImpl->didDrawAllLayers(frame);
}
// Empty visible content area (fullscreen gutter rect)
{
- IntRect layerRect(0, 0, 0, 0);
- child->setPosition(layerRect.location());
+ gfx::Rect layerRect(0, 0, 0, 0);
+ child->setPosition(layerRect.origin());
child->setBounds(layerRect.size());
child->setContentBounds(layerRect.size());
- child->setQuadRect(IntRect(IntPoint(), layerRect.size()));
- child->setQuadVisibleRect(IntRect(IntPoint(), layerRect.size()));
+ child->setQuadRect(gfx::Rect(gfx::Point(), layerRect.size()));
+ child->setQuadVisibleRect(gfx::Rect(gfx::Point(), layerRect.size()));
LayerTreeHostImpl::FrameData frame;
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
@@ -1841,18 +1841,18 @@ TEST_P(LayerTreeHostImplTest, viewportCovered)
EXPECT_EQ(1u, numGutterQuads);
EXPECT_EQ(1u, frame.renderPasses[0]->quadList().size());
- verifyQuadsExactlyCoverRect(frame.renderPasses[0]->quadList(), IntRect(IntPoint::zero(), viewportSize));
+ verifyQuadsExactlyCoverRect(frame.renderPasses[0]->quadList(), gfx::Rect(gfx::Point(), viewportSize));
m_hostImpl->didDrawAllLayers(frame);
}
// Content area in middle of clip rect (four surrounding gutter rects)
{
- IntRect layerRect(500, 500, 200, 200);
- child->setPosition(layerRect.location());
+ gfx::Rect layerRect(500, 500, 200, 200);
+ child->setPosition(layerRect.origin());
child->setBounds(layerRect.size());
child->setContentBounds(layerRect.size());
- child->setQuadRect(IntRect(IntPoint(), layerRect.size()));
- child->setQuadVisibleRect(IntRect(IntPoint(), layerRect.size()));
+ child->setQuadRect(gfx::Rect(gfx::Point(), layerRect.size()));
+ child->setQuadVisibleRect(gfx::Rect(gfx::Point(), layerRect.size()));
LayerTreeHostImpl::FrameData frame;
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
@@ -1864,7 +1864,7 @@ TEST_P(LayerTreeHostImplTest, viewportCovered)
EXPECT_EQ(4u, numGutterQuads);
EXPECT_EQ(5u, frame.renderPasses[0]->quadList().size());
- verifyQuadsExactlyCoverRect(frame.renderPasses[0]->quadList(), IntRect(IntPoint::zero(), viewportSize));
+ verifyQuadsExactlyCoverRect(frame.renderPasses[0]->quadList(), gfx::Rect(gfx::Point(), viewportSize));
m_hostImpl->didDrawAllLayers(frame);
}
@@ -1903,8 +1903,8 @@ TEST_P(LayerTreeHostImplTest, reshapeNotCalledUntilDraw)
m_hostImpl->initializeRenderer(outputSurface.Pass());
scoped_ptr<LayerImpl> root = FakeDrawableLayerImpl::create(1);
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setBounds(IntSize(10, 10));
+ root->setAnchorPoint(gfx::PointF(0, 0));
+ root->setBounds(gfx::Size(10, 10));
root->setDrawsContent(true);
m_hostImpl->setRootLayer(root.Pass());
EXPECT_FALSE(reshapeTracker->reshapeCalled());
@@ -1920,7 +1920,7 @@ class PartialSwapTrackerContext : public FakeWebGraphicsContext3D {
public:
virtual void postSubBufferCHROMIUM(int x, int y, int width, int height)
{
- m_partialSwapRect = IntRect(x, y, width, height);
+ m_partialSwapRect = gfx::Rect(x, y, width, height);
}
virtual WebString getString(WGC3Denum name)
@@ -1931,10 +1931,10 @@ public:
return WebString();
}
- IntRect partialSwapRect() const { return m_partialSwapRect; }
+ gfx::Rect partialSwapRect() const { return m_partialSwapRect; }
private:
- IntRect m_partialSwapRect;
+ gfx::Rect m_partialSwapRect;
};
// Make sure damage tracking propagates all the way to the graphics context,
@@ -1950,18 +1950,18 @@ TEST_P(LayerTreeHostImplTest, partialSwapReceivesDamageRect)
Settings::setPartialSwapEnabled(true);
scoped_ptr<LayerTreeHostImpl> layerTreeHostImpl = LayerTreeHostImpl::create(settings, this);
layerTreeHostImpl->initializeRenderer(outputSurface.Pass());
- layerTreeHostImpl->setViewportSize(IntSize(500, 500), IntSize(500, 500));
+ layerTreeHostImpl->setViewportSize(gfx::Size(500, 500), gfx::Size(500, 500));
scoped_ptr<LayerImpl> root = FakeDrawableLayerImpl::create(1);
scoped_ptr<LayerImpl> child = FakeDrawableLayerImpl::create(2);
- child->setPosition(FloatPoint(12, 13));
- child->setAnchorPoint(FloatPoint(0, 0));
- child->setBounds(IntSize(14, 15));
- child->setContentBounds(IntSize(14, 15));
+ child->setPosition(gfx::PointF(12, 13));
+ child->setAnchorPoint(gfx::PointF(0, 0));
+ child->setBounds(gfx::Size(14, 15));
+ child->setContentBounds(gfx::Size(14, 15));
child->setDrawsContent(true);
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setBounds(IntSize(500, 500));
- root->setContentBounds(IntSize(500, 500));
+ root->setAnchorPoint(gfx::PointF(0, 0));
+ root->setBounds(gfx::Size(500, 500));
+ root->setContentBounds(gfx::Size(500, 500));
root->setDrawsContent(true);
root->addChild(child.Pass());
layerTreeHostImpl->setRootLayer(root.Pass());
@@ -1973,8 +1973,8 @@ TEST_P(LayerTreeHostImplTest, partialSwapReceivesDamageRect)
layerTreeHostImpl->drawLayers(frame);
layerTreeHostImpl->didDrawAllLayers(frame);
layerTreeHostImpl->swapBuffers();
- IntRect actualSwapRect = partialSwapTracker->partialSwapRect();
- IntRect expectedSwapRect = IntRect(IntPoint::zero(), IntSize(500, 500));
+ gfx::Rect actualSwapRect = partialSwapTracker->partialSwapRect();
+ gfx::Rect expectedSwapRect = gfx::Rect(gfx::Point(), gfx::Size(500, 500));
EXPECT_EQ(expectedSwapRect.x(), actualSwapRect.x());
EXPECT_EQ(expectedSwapRect.y(), actualSwapRect.y());
EXPECT_EQ(expectedSwapRect.width(), actualSwapRect.width());
@@ -1982,31 +1982,31 @@ TEST_P(LayerTreeHostImplTest, partialSwapReceivesDamageRect)
// Second frame, only the damaged area should get swapped. Damage should be the union
// of old and new child rects.
- // expected damage rect: IntRect(IntPoint::zero(), IntSize(26, 28));
+ // expected damage rect: gfx::Rect(gfx::Point(), gfx::Size(26, 28));
// expected swap rect: vertically flipped, with origin at bottom left corner.
- layerTreeHostImpl->rootLayer()->children()[0]->setPosition(FloatPoint(0, 0));
+ layerTreeHostImpl->rootLayer()->children()[0]->setPosition(gfx::PointF(0, 0));
EXPECT_TRUE(layerTreeHostImpl->prepareToDraw(frame));
layerTreeHostImpl->drawLayers(frame);
m_hostImpl->didDrawAllLayers(frame);
layerTreeHostImpl->swapBuffers();
actualSwapRect = partialSwapTracker->partialSwapRect();
- expectedSwapRect = IntRect(IntPoint(0, 500-28), IntSize(26, 28));
+ expectedSwapRect = gfx::Rect(gfx::Point(0, 500-28), gfx::Size(26, 28));
EXPECT_EQ(expectedSwapRect.x(), actualSwapRect.x());
EXPECT_EQ(expectedSwapRect.y(), actualSwapRect.y());
EXPECT_EQ(expectedSwapRect.width(), actualSwapRect.width());
EXPECT_EQ(expectedSwapRect.height(), actualSwapRect.height());
// Make sure that partial swap is constrained to the viewport dimensions
- // expected damage rect: IntRect(IntPoint::zero(), IntSize(500, 500));
+ // expected damage rect: gfx::Rect(gfx::Point(), gfx::Size(500, 500));
// expected swap rect: flipped damage rect, but also clamped to viewport
- layerTreeHostImpl->setViewportSize(IntSize(10, 10), IntSize(10, 10));
+ layerTreeHostImpl->setViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
layerTreeHostImpl->rootLayer()->setOpacity(0.7f); // this will damage everything
EXPECT_TRUE(layerTreeHostImpl->prepareToDraw(frame));
layerTreeHostImpl->drawLayers(frame);
m_hostImpl->didDrawAllLayers(frame);
layerTreeHostImpl->swapBuffers();
actualSwapRect = partialSwapTracker->partialSwapRect();
- expectedSwapRect = IntRect(IntPoint::zero(), IntSize(10, 10));
+ expectedSwapRect = gfx::Rect(gfx::Point(), gfx::Size(10, 10));
EXPECT_EQ(expectedSwapRect.x(), actualSwapRect.x());
EXPECT_EQ(expectedSwapRect.y(), actualSwapRect.y());
EXPECT_EQ(expectedSwapRect.width(), actualSwapRect.width());
@@ -2017,13 +2017,13 @@ TEST_P(LayerTreeHostImplTest, rootLayerDoesntCreateExtraSurface)
{
scoped_ptr<LayerImpl> root = FakeDrawableLayerImpl::create(1);
scoped_ptr<LayerImpl> child = FakeDrawableLayerImpl::create(2);
- child->setAnchorPoint(FloatPoint(0, 0));
- child->setBounds(IntSize(10, 10));
- child->setContentBounds(IntSize(10, 10));
+ child->setAnchorPoint(gfx::PointF(0, 0));
+ child->setBounds(gfx::Size(10, 10));
+ child->setContentBounds(gfx::Size(10, 10));
child->setDrawsContent(true);
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setBounds(IntSize(10, 10));
- root->setContentBounds(IntSize(10, 10));
+ root->setAnchorPoint(gfx::PointF(0, 0));
+ root->setBounds(gfx::Size(10, 10));
+ root->setContentBounds(gfx::Size(10, 10));
root->setDrawsContent(true);
root->setOpacity(0.7f);
root->addChild(child.Pass());
@@ -2049,7 +2049,7 @@ public:
SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQuadState());
SkColor gray = SkColorSetRGB(100, 100, 100);
- IntRect quadRect(IntPoint(0, 0), contentBounds());
+ gfx::Rect quadRect(gfx::Point(0, 0), contentBounds());
scoped_ptr<SolidColorDrawQuad> myQuad = SolidColorDrawQuad::create(sharedQuadState, quadRect, gray);
quadSink.append(myQuad.PassAs<DrawQuad>(), appendQuadsData);
}
@@ -2192,7 +2192,7 @@ TEST_P(LayerTreeHostImplTest, partialSwap)
Mock::VerifyAndClearExpectations(&mockContext);
// Damage a portion of the frame.
- myHostImpl->rootLayer()->setUpdateRect(IntRect(0, 0, 2, 3));
+ myHostImpl->rootLayer()->setUpdateRect(gfx::Rect(0, 0, 2, 3));
// The second frame will be partially-swapped (the y coordinates are flipped).
harness.mustSetScissor(0, 7, 2, 3);
@@ -2237,7 +2237,7 @@ static scoped_ptr<LayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, Lay
LayerTreeSettings settings;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, client);
myHostImpl->initializeRenderer(context.Pass());
- myHostImpl->setViewportSize(IntSize(100, 100), IntSize(100, 100));
+ myHostImpl->setViewportSize(gfx::Size(100, 100), gfx::Size(100, 100));
/*
Layers are created as follows:
@@ -2261,30 +2261,30 @@ static scoped_ptr<LayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, Lay
scoped_ptr<LayerImpl> child = LayerImpl::create(2);
scoped_ptr<LayerImpl> grandChild = FakeLayerWithQuads::create(3);
- IntRect rootRect(0, 0, 100, 100);
- IntRect childRect(10, 10, 50, 50);
- IntRect grandChildRect(5, 5, 150, 150);
+ gfx::Rect rootRect(0, 0, 100, 100);
+ gfx::Rect childRect(10, 10, 50, 50);
+ gfx::Rect grandChildRect(5, 5, 150, 150);
root->createRenderSurface();
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setPosition(FloatPoint(rootRect.x(), rootRect.y()));
- root->setBounds(IntSize(rootRect.width(), rootRect.height()));
+ root->setAnchorPoint(gfx::PointF(0, 0));
+ root->setPosition(gfx::PointF(rootRect.x(), rootRect.y()));
+ root->setBounds(gfx::Size(rootRect.width(), rootRect.height()));
root->setContentBounds(root->bounds());
root->setVisibleContentRect(rootRect);
root->setDrawsContent(false);
- root->renderSurface()->setContentRect(IntRect(IntPoint(), IntSize(rootRect.width(), rootRect.height())));
+ root->renderSurface()->setContentRect(gfx::Rect(gfx::Point(), gfx::Size(rootRect.width(), rootRect.height())));
- child->setAnchorPoint(FloatPoint(0, 0));
- child->setPosition(FloatPoint(childRect.x(), childRect.y()));
+ child->setAnchorPoint(gfx::PointF(0, 0));
+ child->setPosition(gfx::PointF(childRect.x(), childRect.y()));
child->setOpacity(0.5f);
- child->setBounds(IntSize(childRect.width(), childRect.height()));
+ child->setBounds(gfx::Size(childRect.width(), childRect.height()));
child->setContentBounds(child->bounds());
child->setVisibleContentRect(childRect);
child->setDrawsContent(false);
- grandChild->setAnchorPoint(FloatPoint(0, 0));
- grandChild->setPosition(IntPoint(grandChildRect.x(), grandChildRect.y()));
- grandChild->setBounds(IntSize(grandChildRect.width(), grandChildRect.height()));
+ grandChild->setAnchorPoint(gfx::PointF(0, 0));
+ grandChild->setPosition(gfx::Point(grandChildRect.x(), grandChildRect.y()));
+ grandChild->setBounds(gfx::Size(grandChildRect.width(), grandChildRect.height()));
grandChild->setContentBounds(grandChild->bounds());
grandChild->setVisibleContentRect(grandChildRect);
grandChild->setDrawsContent(true);
@@ -2631,7 +2631,7 @@ public:
{
DCHECK(provider);
int pool = 0;
- IntSize size(10, 10);
+ gfx::Size size(10, 10);
GLenum format = GL_RGBA;
ResourceProvider::TextureUsageHint hint = ResourceProvider::TextureUsageAny;
setScrollbarGeometry(ScrollbarGeometryFixedThumb::create(FakeWebScrollbarThemeGeometryNonEmpty::create()));
@@ -2650,11 +2650,11 @@ protected:
static inline scoped_ptr<RenderPass> createRenderPassWithResource(ResourceProvider* provider)
{
- ResourceProvider::ResourceId resourceId = provider->createResource(0, IntSize(1, 1), GL_RGBA, ResourceProvider::TextureUsageAny);
+ ResourceProvider::ResourceId resourceId = provider->createResource(0, gfx::Size(1, 1), GL_RGBA, ResourceProvider::TextureUsageAny);
- scoped_ptr<TestRenderPass> pass = TestRenderPass::create(RenderPass::Id(1, 1), IntRect(0, 0, 1, 1), WebTransformationMatrix());
- scoped_ptr<SharedQuadState> sharedState = SharedQuadState::create(WebTransformationMatrix(), IntRect(0, 0, 1, 1), IntRect(0, 0, 1, 1), 1, false);
- scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::create(sharedState.get(), IntRect(0, 0, 1, 1), resourceId, false, FloatRect(0, 0, 1, 1), false);
+ scoped_ptr<TestRenderPass> pass = TestRenderPass::create(RenderPass::Id(1, 1), gfx::Rect(0, 0, 1, 1), WebTransformationMatrix());
+ scoped_ptr<SharedQuadState> sharedState = SharedQuadState::create(WebTransformationMatrix(), gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1), 1, false);
+ scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::create(sharedState.get(), gfx::Rect(0, 0, 1, 1), resourceId, false, gfx::RectF(0, 0, 1, 1), false);
pass->appendSharedQuadState(sharedState.Pass());
pass->appendQuad(quad.PassAs<DrawQuad>());
@@ -2667,42 +2667,42 @@ TEST_P(LayerTreeHostImplTest, dontUseOldResourcesAfterLostContext)
int layerId = 1;
scoped_ptr<LayerImpl> rootLayer(LayerImpl::create(layerId++));
- rootLayer->setBounds(IntSize(10, 10));
- rootLayer->setAnchorPoint(FloatPoint(0, 0));
+ rootLayer->setBounds(gfx::Size(10, 10));
+ rootLayer->setAnchorPoint(gfx::PointF(0, 0));
scoped_ptr<TiledLayerImpl> tileLayer = TiledLayerImpl::create(layerId++);
- tileLayer->setBounds(IntSize(10, 10));
- tileLayer->setAnchorPoint(FloatPoint(0, 0));
- tileLayer->setContentBounds(IntSize(10, 10));
+ tileLayer->setBounds(gfx::Size(10, 10));
+ tileLayer->setAnchorPoint(gfx::PointF(0, 0));
+ tileLayer->setContentBounds(gfx::Size(10, 10));
tileLayer->setDrawsContent(true);
tileLayer->setSkipsDraw(false);
- scoped_ptr<LayerTilingData> tilingData(LayerTilingData::create(IntSize(10, 10), LayerTilingData::NoBorderTexels));
- tilingData->setBounds(IntSize(10, 10));
+ scoped_ptr<LayerTilingData> tilingData(LayerTilingData::create(gfx::Size(10, 10), LayerTilingData::NoBorderTexels));
+ tilingData->setBounds(gfx::Size(10, 10));
tileLayer->setTilingData(*tilingData);
- tileLayer->pushTileProperties(0, 0, 1, IntRect(0, 0, 10, 10), false);
+ tileLayer->pushTileProperties(0, 0, 1, gfx::Rect(0, 0, 10, 10), false);
rootLayer->addChild(tileLayer.PassAs<LayerImpl>());
scoped_ptr<TextureLayerImpl> textureLayer = TextureLayerImpl::create(layerId++);
- textureLayer->setBounds(IntSize(10, 10));
- textureLayer->setAnchorPoint(FloatPoint(0, 0));
- textureLayer->setContentBounds(IntSize(10, 10));
+ textureLayer->setBounds(gfx::Size(10, 10));
+ textureLayer->setAnchorPoint(gfx::PointF(0, 0));
+ textureLayer->setContentBounds(gfx::Size(10, 10));
textureLayer->setDrawsContent(true);
textureLayer->setTextureId(1);
rootLayer->addChild(textureLayer.PassAs<LayerImpl>());
scoped_ptr<TiledLayerImpl> maskLayer = TiledLayerImpl::create(layerId++);
- maskLayer->setBounds(IntSize(10, 10));
- maskLayer->setAnchorPoint(FloatPoint(0, 0));
- maskLayer->setContentBounds(IntSize(10, 10));
+ maskLayer->setBounds(gfx::Size(10, 10));
+ maskLayer->setAnchorPoint(gfx::PointF(0, 0));
+ maskLayer->setContentBounds(gfx::Size(10, 10));
maskLayer->setDrawsContent(true);
maskLayer->setSkipsDraw(false);
maskLayer->setTilingData(*tilingData);
- maskLayer->pushTileProperties(0, 0, 1, IntRect(0, 0, 10, 10), false);
+ maskLayer->pushTileProperties(0, 0, 1, gfx::Rect(0, 0, 10, 10), false);
scoped_ptr<TextureLayerImpl> textureLayerWithMask = TextureLayerImpl::create(layerId++);
- textureLayerWithMask->setBounds(IntSize(10, 10));
- textureLayerWithMask->setAnchorPoint(FloatPoint(0, 0));
- textureLayerWithMask->setContentBounds(IntSize(10, 10));
+ textureLayerWithMask->setBounds(gfx::Size(10, 10));
+ textureLayerWithMask->setAnchorPoint(gfx::PointF(0, 0));
+ textureLayerWithMask->setContentBounds(gfx::Size(10, 10));
textureLayerWithMask->setDrawsContent(true);
textureLayerWithMask->setTextureId(1);
textureLayerWithMask->setMaskLayer(maskLayer.PassAs<LayerImpl>());
@@ -2715,53 +2715,51 @@ TEST_P(LayerTreeHostImplTest, dontUseOldResourcesAfterLostContext)
base::Bind(FakeVideoFrame::toVideoFrame);
FakeVideoFrameProvider provider;
provider.setFrame(&videoFrame);
- scoped_ptr<VideoLayerImpl> videoLayer =
- VideoLayerImpl::create(layerId++, &provider, unwrapper);
- videoLayer->setBounds(IntSize(10, 10));
- videoLayer->setAnchorPoint(FloatPoint(0, 0));
- videoLayer->setContentBounds(IntSize(10, 10));
+ scoped_ptr<VideoLayerImpl> videoLayer = VideoLayerImpl::create(layerId++, &provider, unwrapper);
+ videoLayer->setBounds(gfx::Size(10, 10));
+ videoLayer->setAnchorPoint(gfx::PointF(0, 0));
+ videoLayer->setContentBounds(gfx::Size(10, 10));
videoLayer->setDrawsContent(true);
videoLayer->setLayerTreeHostImpl(m_hostImpl.get());
rootLayer->addChild(videoLayer.PassAs<LayerImpl>());
FakeVideoFrameProvider hwProvider;
- scoped_ptr<VideoLayerImpl> hwVideoLayer =
- VideoLayerImpl::create(layerId++, &hwProvider, unwrapper);
- hwVideoLayer->setBounds(IntSize(10, 10));
- hwVideoLayer->setAnchorPoint(FloatPoint(0, 0));
- hwVideoLayer->setContentBounds(IntSize(10, 10));
+ scoped_ptr<VideoLayerImpl> hwVideoLayer = VideoLayerImpl::create(layerId++, &hwProvider, unwrapper);
+ hwVideoLayer->setBounds(gfx::Size(10, 10));
+ hwVideoLayer->setAnchorPoint(gfx::PointF(0, 0));
+ hwVideoLayer->setContentBounds(gfx::Size(10, 10));
hwVideoLayer->setDrawsContent(true);
hwVideoLayer->setLayerTreeHostImpl(m_hostImpl.get());
rootLayer->addChild(hwVideoLayer.PassAs<LayerImpl>());
scoped_ptr<IOSurfaceLayerImpl> ioSurfaceLayer = IOSurfaceLayerImpl::create(layerId++);
- ioSurfaceLayer->setBounds(IntSize(10, 10));
- ioSurfaceLayer->setAnchorPoint(FloatPoint(0, 0));
- ioSurfaceLayer->setContentBounds(IntSize(10, 10));
+ ioSurfaceLayer->setBounds(gfx::Size(10, 10));
+ ioSurfaceLayer->setAnchorPoint(gfx::PointF(0, 0));
+ ioSurfaceLayer->setContentBounds(gfx::Size(10, 10));
ioSurfaceLayer->setDrawsContent(true);
- ioSurfaceLayer->setIOSurfaceProperties(1, IntSize(10, 10));
+ ioSurfaceLayer->setIOSurfaceProperties(1, gfx::Size(10, 10));
ioSurfaceLayer->setLayerTreeHostImpl(m_hostImpl.get());
rootLayer->addChild(ioSurfaceLayer.PassAs<LayerImpl>());
scoped_ptr<HeadsUpDisplayLayerImpl> hudLayer = HeadsUpDisplayLayerImpl::create(layerId++);
- hudLayer->setBounds(IntSize(10, 10));
- hudLayer->setAnchorPoint(FloatPoint(0, 0));
- hudLayer->setContentBounds(IntSize(10, 10));
+ hudLayer->setBounds(gfx::Size(10, 10));
+ hudLayer->setAnchorPoint(gfx::PointF(0, 0));
+ hudLayer->setContentBounds(gfx::Size(10, 10));
hudLayer->setDrawsContent(true);
hudLayer->setLayerTreeHostImpl(m_hostImpl.get());
rootLayer->addChild(hudLayer.PassAs<LayerImpl>());
scoped_ptr<FakeScrollbarLayerImpl> scrollbarLayer(FakeScrollbarLayerImpl::create(layerId++));
- scrollbarLayer->setBounds(IntSize(10, 10));
- scrollbarLayer->setContentBounds(IntSize(10, 10));
+ scrollbarLayer->setBounds(gfx::Size(10, 10));
+ scrollbarLayer->setContentBounds(gfx::Size(10, 10));
scrollbarLayer->setDrawsContent(true);
scrollbarLayer->setLayerTreeHostImpl(m_hostImpl.get());
scrollbarLayer->createResources(m_hostImpl->resourceProvider());
rootLayer->addChild(scrollbarLayer.PassAs<LayerImpl>());
scoped_ptr<DelegatedRendererLayerImpl> delegatedRendererLayer(DelegatedRendererLayerImpl::create(layerId++));
- delegatedRendererLayer->setBounds(IntSize(10, 10));
- delegatedRendererLayer->setContentBounds(IntSize(10, 10));
+ delegatedRendererLayer->setBounds(gfx::Size(10, 10));
+ delegatedRendererLayer->setContentBounds(gfx::Size(10, 10));
delegatedRendererLayer->setDrawsContent(true);
delegatedRendererLayer->setLayerTreeHostImpl(m_hostImpl.get());
ScopedPtrVector<RenderPass> passList;
@@ -2867,25 +2865,25 @@ private:
TEST_P(LayerTreeHostImplTest, layersFreeTextures)
{
scoped_ptr<LayerImpl> rootLayer(LayerImpl::create(1));
- rootLayer->setBounds(IntSize(10, 10));
- rootLayer->setAnchorPoint(FloatPoint(0, 0));
+ rootLayer->setBounds(gfx::Size(10, 10));
+ rootLayer->setAnchorPoint(gfx::PointF(0, 0));
scoped_ptr<TiledLayerImpl> tileLayer = TiledLayerImpl::create(2);
- tileLayer->setBounds(IntSize(10, 10));
- tileLayer->setAnchorPoint(FloatPoint(0, 0));
- tileLayer->setContentBounds(IntSize(10, 10));
+ tileLayer->setBounds(gfx::Size(10, 10));
+ tileLayer->setAnchorPoint(gfx::PointF(0, 0));
+ tileLayer->setContentBounds(gfx::Size(10, 10));
tileLayer->setDrawsContent(true);
tileLayer->setSkipsDraw(false);
- scoped_ptr<LayerTilingData> tilingData(LayerTilingData::create(IntSize(10, 10), LayerTilingData::NoBorderTexels));
- tilingData->setBounds(IntSize(10, 10));
+ scoped_ptr<LayerTilingData> tilingData(LayerTilingData::create(gfx::Size(10, 10), LayerTilingData::NoBorderTexels));
+ tilingData->setBounds(gfx::Size(10, 10));
tileLayer->setTilingData(*tilingData);
- tileLayer->pushTileProperties(0, 0, 1, IntRect(0, 0, 10, 10), false);
+ tileLayer->pushTileProperties(0, 0, 1, gfx::Rect(0, 0, 10, 10), false);
rootLayer->addChild(tileLayer.PassAs<LayerImpl>());
scoped_ptr<TextureLayerImpl> textureLayer = TextureLayerImpl::create(3);
- textureLayer->setBounds(IntSize(10, 10));
- textureLayer->setAnchorPoint(FloatPoint(0, 0));
- textureLayer->setContentBounds(IntSize(10, 10));
+ textureLayer->setBounds(gfx::Size(10, 10));
+ textureLayer->setAnchorPoint(gfx::PointF(0, 0));
+ textureLayer->setContentBounds(gfx::Size(10, 10));
textureLayer->setDrawsContent(true);
textureLayer->setTextureId(1);
rootLayer->addChild(textureLayer.PassAs<LayerImpl>());
@@ -2893,21 +2891,20 @@ TEST_P(LayerTreeHostImplTest, layersFreeTextures)
VideoLayerImpl::FrameUnwrapper unwrapper =
base::Bind(FakeVideoFrame::toVideoFrame);
FakeVideoFrameProvider provider;
- scoped_ptr<VideoLayerImpl> videoLayer =
- VideoLayerImpl::create(4, &provider, unwrapper);
- videoLayer->setBounds(IntSize(10, 10));
- videoLayer->setAnchorPoint(FloatPoint(0, 0));
- videoLayer->setContentBounds(IntSize(10, 10));
+ scoped_ptr<VideoLayerImpl> videoLayer = VideoLayerImpl::create(4, &provider, unwrapper);
+ videoLayer->setBounds(gfx::Size(10, 10));
+ videoLayer->setAnchorPoint(gfx::PointF(0, 0));
+ videoLayer->setContentBounds(gfx::Size(10, 10));
videoLayer->setDrawsContent(true);
videoLayer->setLayerTreeHostImpl(m_hostImpl.get());
rootLayer->addChild(videoLayer.PassAs<LayerImpl>());
scoped_ptr<IOSurfaceLayerImpl> ioSurfaceLayer = IOSurfaceLayerImpl::create(5);
- ioSurfaceLayer->setBounds(IntSize(10, 10));
- ioSurfaceLayer->setAnchorPoint(FloatPoint(0, 0));
- ioSurfaceLayer->setContentBounds(IntSize(10, 10));
+ ioSurfaceLayer->setBounds(gfx::Size(10, 10));
+ ioSurfaceLayer->setAnchorPoint(gfx::PointF(0, 0));
+ ioSurfaceLayer->setContentBounds(gfx::Size(10, 10));
ioSurfaceLayer->setDrawsContent(true);
- ioSurfaceLayer->setIOSurfaceProperties(1, IntSize(10, 10));
+ ioSurfaceLayer->setIOSurfaceProperties(1, gfx::Size(10, 10));
ioSurfaceLayer->setLayerTreeHostImpl(m_hostImpl.get());
rootLayer->addChild(ioSurfaceLayer.PassAs<LayerImpl>());
@@ -2967,12 +2964,12 @@ TEST_P(LayerTreeHostImplTest, hasTransparentBackground)
Mock::VerifyAndClearExpectations(&mockContext);
}
-static void addDrawingLayerTo(LayerImpl* parent, int id, const IntRect& layerRect, LayerImpl** result)
+static void addDrawingLayerTo(LayerImpl* parent, int id, const gfx::Rect& layerRect, LayerImpl** result)
{
scoped_ptr<LayerImpl> layer = FakeLayerWithQuads::create(id);
LayerImpl* layerPtr = layer.get();
- layerPtr->setAnchorPoint(FloatPoint(0, 0));
- layerPtr->setPosition(FloatPoint(layerRect.location()));
+ layerPtr->setAnchorPoint(gfx::PointF(0, 0));
+ layerPtr->setPosition(gfx::PointF(layerRect.origin()));
layerPtr->setBounds(layerRect.size());
layerPtr->setContentBounds(layerRect.size());
layerPtr->setDrawsContent(true); // only children draw content
@@ -2982,7 +2979,7 @@ static void addDrawingLayerTo(LayerImpl* parent, int id, const IntRect& layerRec
*result = layerPtr;
}
-static void setupLayersForTextureCaching(LayerTreeHostImpl* layerTreeHostImpl, LayerImpl*& rootPtr, LayerImpl*& intermediateLayerPtr, LayerImpl*& surfaceLayerPtr, LayerImpl*& childPtr, const IntSize& rootSize)
+static void setupLayersForTextureCaching(LayerTreeHostImpl* layerTreeHostImpl, LayerImpl*& rootPtr, LayerImpl*& intermediateLayerPtr, LayerImpl*& surfaceLayerPtr, LayerImpl*& childPtr, const gfx::Size& rootSize)
{
scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
@@ -2992,24 +2989,24 @@ static void setupLayersForTextureCaching(LayerTreeHostImpl* layerTreeHostImpl, L
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
rootPtr = root.get();
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setPosition(FloatPoint(0, 0));
+ root->setAnchorPoint(gfx::PointF(0, 0));
+ root->setPosition(gfx::PointF(0, 0));
root->setBounds(rootSize);
root->setContentBounds(rootSize);
root->setDrawsContent(true);
layerTreeHostImpl->setRootLayer(root.Pass());
- addDrawingLayerTo(rootPtr, 2, IntRect(10, 10, rootSize.width(), rootSize.height()), &intermediateLayerPtr);
+ addDrawingLayerTo(rootPtr, 2, gfx::Rect(10, 10, rootSize.width(), rootSize.height()), &intermediateLayerPtr);
intermediateLayerPtr->setDrawsContent(false); // only children draw content
// Surface layer is the layer that changes its opacity
// It will contain other layers that draw content.
- addDrawingLayerTo(intermediateLayerPtr, 3, IntRect(10, 10, rootSize.width(), rootSize.height()), &surfaceLayerPtr);
+ addDrawingLayerTo(intermediateLayerPtr, 3, gfx::Rect(10, 10, rootSize.width(), rootSize.height()), &surfaceLayerPtr);
surfaceLayerPtr->setDrawsContent(false); // only children draw content
surfaceLayerPtr->setOpacity(0.5f); // This will cause it to have a surface
// Child of the surface layer will produce some quads
- addDrawingLayerTo(surfaceLayerPtr, 4, IntRect(5, 5, rootSize.width() - 25, rootSize.height() - 25), &childPtr);
+ addDrawingLayerTo(surfaceLayerPtr, 4, gfx::Rect(5, 5, rootSize.width() - 25, rootSize.height() - 25), &childPtr);
}
class GLRendererWithReleaseTextures : public GLRenderer {
@@ -3022,7 +3019,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithClipping)
Settings::setPartialSwapEnabled(true);
LayerTreeSettings settings;
- settings.minimumOcclusionTrackingSize = IntSize();
+ settings.minimumOcclusionTrackingSize = gfx::Size();
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
LayerImpl* rootPtr;
@@ -3030,31 +3027,31 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithClipping)
scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
- IntSize rootSize(100, 100);
+ gfx::Size rootSize(100, 100);
myHostImpl->initializeRenderer(context.Pass());
- myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height()));
+ myHostImpl->setViewportSize(gfx::Size(rootSize.width(), rootSize.height()), gfx::Size(rootSize.width(), rootSize.height()));
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
rootPtr = root.get();
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setPosition(FloatPoint(0, 0));
+ root->setAnchorPoint(gfx::PointF(0, 0));
+ root->setPosition(gfx::PointF(0, 0));
root->setBounds(rootSize);
root->setContentBounds(rootSize);
root->setDrawsContent(true);
root->setMasksToBounds(true);
myHostImpl->setRootLayer(root.Pass());
- addDrawingLayerTo(rootPtr, 3, IntRect(0, 0, rootSize.width(), rootSize.height()), &surfaceLayerPtr);
+ addDrawingLayerTo(rootPtr, 3, gfx::Rect(0, 0, rootSize.width(), rootSize.height()), &surfaceLayerPtr);
surfaceLayerPtr->setDrawsContent(false);
// Surface layer is the layer that changes its opacity
// It will contain other layers that draw content.
surfaceLayerPtr->setOpacity(0.5f); // This will cause it to have a surface
- addDrawingLayerTo(surfaceLayerPtr, 4, IntRect(0, 0, 100, 3), 0);
- addDrawingLayerTo(surfaceLayerPtr, 5, IntRect(0, 97, 100, 3), 0);
+ addDrawingLayerTo(surfaceLayerPtr, 4, gfx::Rect(0, 0, 100, 3), 0);
+ addDrawingLayerTo(surfaceLayerPtr, 5, gfx::Rect(0, 97, 100, 3), 0);
// Rotation will put part of the child ouside the bounds of the root layer.
// Nevertheless, the child layers should be drawn.
@@ -3081,7 +3078,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithClipping)
EXPECT_LT(quadVisibleRect.width(), 100);
// Verify that the render surface texture is *not* clipped.
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), frame.renderPasses[0]->outputRect());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), frame.renderPasses[0]->outputRect());
EXPECT_EQ(DrawQuad::RenderPass, frame.renderPasses[1]->quadList()[0]->material());
RenderPassDrawQuad* quad = static_cast<RenderPassDrawQuad*>(frame.renderPasses[1]->quadList()[0]);
@@ -3119,7 +3116,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusion)
Settings::setPartialSwapEnabled(false);
LayerTreeSettings settings;
- settings.minimumOcclusionTrackingSize = IntSize();
+ settings.minimumOcclusionTrackingSize = gfx::Size();
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
// Layers are structure as follows:
@@ -3142,32 +3139,32 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusion)
scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
- IntSize rootSize(1000, 1000);
+ gfx::Size rootSize(1000, 1000);
myHostImpl->initializeRenderer(context.Pass());
- myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height()));
+ myHostImpl->setViewportSize(gfx::Size(rootSize.width(), rootSize.height()), gfx::Size(rootSize.width(), rootSize.height()));
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
rootPtr = root.get();
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setPosition(FloatPoint(0, 0));
+ root->setAnchorPoint(gfx::PointF(0, 0));
+ root->setPosition(gfx::PointF(0, 0));
root->setBounds(rootSize);
root->setContentBounds(rootSize);
root->setDrawsContent(true);
root->setMasksToBounds(true);
myHostImpl->setRootLayer(root.Pass());
- addDrawingLayerTo(rootPtr, 2, IntRect(300, 300, 300, 300), &layerS1Ptr);
+ addDrawingLayerTo(rootPtr, 2, gfx::Rect(300, 300, 300, 300), &layerS1Ptr);
layerS1Ptr->setForceRenderSurface(true);
- addDrawingLayerTo(layerS1Ptr, 3, IntRect(10, 10, 10, 10), 0); // L11
- addDrawingLayerTo(layerS1Ptr, 4, IntRect(0, 0, 30, 30), 0); // L12
+ addDrawingLayerTo(layerS1Ptr, 3, gfx::Rect(10, 10, 10, 10), 0); // L11
+ addDrawingLayerTo(layerS1Ptr, 4, gfx::Rect(0, 0, 30, 30), 0); // L12
- addDrawingLayerTo(rootPtr, 5, IntRect(550, 250, 300, 400), &layerS2Ptr);
+ addDrawingLayerTo(rootPtr, 5, gfx::Rect(550, 250, 300, 400), &layerS2Ptr);
layerS2Ptr->setForceRenderSurface(true);
- addDrawingLayerTo(layerS2Ptr, 6, IntRect(20, 20, 5, 5), 0); // L21
+ addDrawingLayerTo(layerS2Ptr, 6, gfx::Rect(20, 20, 5, 5), 0); // L21
// Initial draw - must receive all quads
{
@@ -3235,7 +3232,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut)
Settings::setPartialSwapEnabled(false);
LayerTreeSettings settings;
- settings.minimumOcclusionTrackingSize = IntSize();
+ settings.minimumOcclusionTrackingSize = gfx::Size();
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
// Layers are structure as follows:
@@ -3255,33 +3252,33 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut)
scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
- IntSize rootSize(1000, 1000);
+ gfx::Size rootSize(1000, 1000);
myHostImpl->initializeRenderer(context.Pass());
- myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height()));
+ myHostImpl->setViewportSize(gfx::Size(rootSize.width(), rootSize.height()), gfx::Size(rootSize.width(), rootSize.height()));
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
rootPtr = root.get();
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setPosition(FloatPoint(0, 0));
+ root->setAnchorPoint(gfx::PointF(0, 0));
+ root->setPosition(gfx::PointF(0, 0));
root->setBounds(rootSize);
root->setContentBounds(rootSize);
root->setDrawsContent(true);
root->setMasksToBounds(true);
myHostImpl->setRootLayer(root.Pass());
- addDrawingLayerTo(rootPtr, 2, IntRect(0, 0, 800, 800), &layerS1Ptr);
+ addDrawingLayerTo(rootPtr, 2, gfx::Rect(0, 0, 800, 800), &layerS1Ptr);
layerS1Ptr->setForceRenderSurface(true);
layerS1Ptr->setDrawsContent(false);
- addDrawingLayerTo(layerS1Ptr, 3, IntRect(0, 0, 300, 300), 0); // L11
- addDrawingLayerTo(layerS1Ptr, 4, IntRect(0, 500, 300, 300), 0); // L12
- addDrawingLayerTo(layerS1Ptr, 5, IntRect(500, 0, 300, 300), 0); // L13
- addDrawingLayerTo(layerS1Ptr, 6, IntRect(500, 500, 300, 300), 0); // L14
- addDrawingLayerTo(layerS1Ptr, 9, IntRect(500, 500, 300, 300), 0); // L14
+ addDrawingLayerTo(layerS1Ptr, 3, gfx::Rect(0, 0, 300, 300), 0); // L11
+ addDrawingLayerTo(layerS1Ptr, 4, gfx::Rect(0, 500, 300, 300), 0); // L12
+ addDrawingLayerTo(layerS1Ptr, 5, gfx::Rect(500, 0, 300, 300), 0); // L13
+ addDrawingLayerTo(layerS1Ptr, 6, gfx::Rect(500, 500, 300, 300), 0); // L14
+ addDrawingLayerTo(layerS1Ptr, 9, gfx::Rect(500, 500, 300, 300), 0); // L14
- addDrawingLayerTo(rootPtr, 7, IntRect(450, 450, 450, 450), &layerS2Ptr);
+ addDrawingLayerTo(rootPtr, 7, gfx::Rect(450, 450, 450, 450), &layerS2Ptr);
layerS2Ptr->setForceRenderSurface(true);
// Initial draw - must receive all quads
@@ -3351,7 +3348,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal)
Settings::setPartialSwapEnabled(false);
LayerTreeSettings settings;
- settings.minimumOcclusionTrackingSize = IntSize();
+ settings.minimumOcclusionTrackingSize = gfx::Size();
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
// Layers are structured as follows:
@@ -3369,29 +3366,29 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal)
scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
- IntSize rootSize(1000, 1000);
+ gfx::Size rootSize(1000, 1000);
myHostImpl->initializeRenderer(context.Pass());
- myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height()));
+ myHostImpl->setViewportSize(gfx::Size(rootSize.width(), rootSize.height()), gfx::Size(rootSize.width(), rootSize.height()));
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
rootPtr = root.get();
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setPosition(FloatPoint(0, 0));
+ root->setAnchorPoint(gfx::PointF(0, 0));
+ root->setPosition(gfx::PointF(0, 0));
root->setBounds(rootSize);
root->setContentBounds(rootSize);
root->setDrawsContent(true);
root->setMasksToBounds(true);
myHostImpl->setRootLayer(root.Pass());
- addDrawingLayerTo(rootPtr, 2, IntRect(0, 0, 400, 400), &layerS1Ptr);
+ addDrawingLayerTo(rootPtr, 2, gfx::Rect(0, 0, 400, 400), &layerS1Ptr);
layerS1Ptr->setForceRenderSurface(true);
- addDrawingLayerTo(layerS1Ptr, 3, IntRect(0, 0, 300, 300), 0); // L11
- addDrawingLayerTo(layerS1Ptr, 4, IntRect(100, 0, 300, 300), 0); // L12
+ addDrawingLayerTo(layerS1Ptr, 3, gfx::Rect(0, 0, 300, 300), 0); // L11
+ addDrawingLayerTo(layerS1Ptr, 4, gfx::Rect(100, 0, 300, 300), 0); // L12
- addDrawingLayerTo(rootPtr, 7, IntRect(200, 0, 300, 300), &layerS2Ptr);
+ addDrawingLayerTo(rootPtr, 7, gfx::Rect(200, 0, 300, 300), &layerS2Ptr);
layerS2Ptr->setForceRenderSurface(true);
// Initial draw - must receive all quads
@@ -3452,23 +3449,23 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned)
scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
- IntSize rootSize(1000, 1000);
+ gfx::Size rootSize(1000, 1000);
myHostImpl->initializeRenderer(context.Pass());
- myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height()));
+ myHostImpl->setViewportSize(gfx::Size(rootSize.width(), rootSize.height()), gfx::Size(rootSize.width(), rootSize.height()));
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
rootPtr = root.get();
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setPosition(FloatPoint(0, 0));
+ root->setAnchorPoint(gfx::PointF(0, 0));
+ root->setPosition(gfx::PointF(0, 0));
root->setBounds(rootSize);
root->setContentBounds(rootSize);
root->setDrawsContent(true);
root->setMasksToBounds(true);
myHostImpl->setRootLayer(root.Pass());
- addDrawingLayerTo(rootPtr, 2, IntRect(0, 0, 400, 400), &layerS1Ptr);
+ addDrawingLayerTo(rootPtr, 2, gfx::Rect(0, 0, 400, 400), &layerS1Ptr);
layerS1Ptr->setForceRenderSurface(true);
WebTransformationMatrix transform = layerS1Ptr->transform();
transform.translate(200, 200);
@@ -3476,7 +3473,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned)
transform.translate(-200, -200);
layerS1Ptr->setTransform(transform);
- addDrawingLayerTo(layerS1Ptr, 3, IntRect(200, 0, 200, 400), 0); // L11
+ addDrawingLayerTo(layerS1Ptr, 3, gfx::Rect(200, 0, 200, 400), 0); // L11
// Initial draw - must receive all quads
{
@@ -3514,7 +3511,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap)
Settings::setPartialSwapEnabled(true);
LayerTreeSettings settings;
- settings.minimumOcclusionTrackingSize = IntSize();
+ settings.minimumOcclusionTrackingSize = gfx::Size();
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
// Layers are structure as follows:
@@ -3537,32 +3534,32 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap)
scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
- IntSize rootSize(1000, 1000);
+ gfx::Size rootSize(1000, 1000);
myHostImpl->initializeRenderer(context.Pass());
- myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height()));
+ myHostImpl->setViewportSize(gfx::Size(rootSize.width(), rootSize.height()), gfx::Size(rootSize.width(), rootSize.height()));
scoped_ptr<LayerImpl> root = LayerImpl::create(1);
rootPtr = root.get();
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setPosition(FloatPoint(0, 0));
+ root->setAnchorPoint(gfx::PointF(0, 0));
+ root->setPosition(gfx::PointF(0, 0));
root->setBounds(rootSize);
root->setContentBounds(rootSize);
root->setDrawsContent(true);
root->setMasksToBounds(true);
myHostImpl->setRootLayer(root.Pass());
- addDrawingLayerTo(rootPtr, 2, IntRect(300, 300, 300, 300), &layerS1Ptr);
+ addDrawingLayerTo(rootPtr, 2, gfx::Rect(300, 300, 300, 300), &layerS1Ptr);
layerS1Ptr->setForceRenderSurface(true);
- addDrawingLayerTo(layerS1Ptr, 3, IntRect(10, 10, 10, 10), 0); // L11
- addDrawingLayerTo(layerS1Ptr, 4, IntRect(0, 0, 30, 30), 0); // L12
+ addDrawingLayerTo(layerS1Ptr, 3, gfx::Rect(10, 10, 10, 10), 0); // L11
+ addDrawingLayerTo(layerS1Ptr, 4, gfx::Rect(0, 0, 30, 30), 0); // L12
- addDrawingLayerTo(rootPtr, 5, IntRect(550, 250, 300, 400), &layerS2Ptr);
+ addDrawingLayerTo(rootPtr, 5, gfx::Rect(550, 250, 300, 400), &layerS2Ptr);
layerS2Ptr->setForceRenderSurface(true);
- addDrawingLayerTo(layerS2Ptr, 6, IntRect(20, 20, 5, 5), 0); // L21
+ addDrawingLayerTo(layerS2Ptr, 6, gfx::Rect(20, 20, 5, 5), 0); // L21
// Initial draw - must receive all quads
{
@@ -3627,7 +3624,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithScissor)
Settings::setPartialSwapEnabled(false);
LayerTreeSettings settings;
- settings.minimumOcclusionTrackingSize = IntSize();
+ settings.minimumOcclusionTrackingSize = gfx::Size();
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
/*
@@ -3652,36 +3649,36 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithScissor)
scoped_ptr<TiledLayerImpl> child = TiledLayerImpl::create(2);
scoped_ptr<LayerImpl> grandChild = LayerImpl::create(3);
- IntRect rootRect(0, 0, 100, 100);
- IntRect childRect(10, 10, 50, 50);
- IntRect grandChildRect(5, 5, 150, 150);
+ gfx::Rect rootRect(0, 0, 100, 100);
+ gfx::Rect childRect(10, 10, 50, 50);
+ gfx::Rect grandChildRect(5, 5, 150, 150);
scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
myHostImpl->initializeRenderer(context.Pass());
- root->setAnchorPoint(FloatPoint(0, 0));
- root->setPosition(FloatPoint(rootRect.x(), rootRect.y()));
- root->setBounds(IntSize(rootRect.width(), rootRect.height()));
+ root->setAnchorPoint(gfx::PointF(0, 0));
+ root->setPosition(gfx::PointF(rootRect.x(), rootRect.y()));
+ root->setBounds(gfx::Size(rootRect.width(), rootRect.height()));
root->setContentBounds(root->bounds());
root->setDrawsContent(true);
root->setMasksToBounds(true);
- child->setAnchorPoint(FloatPoint(0, 0));
- child->setPosition(FloatPoint(childRect.x(), childRect.y()));
+ child->setAnchorPoint(gfx::PointF(0, 0));
+ child->setPosition(gfx::PointF(childRect.x(), childRect.y()));
child->setOpacity(0.5);
- child->setBounds(IntSize(childRect.width(), childRect.height()));
+ child->setBounds(gfx::Size(childRect.width(), childRect.height()));
child->setContentBounds(child->bounds());
child->setDrawsContent(true);
child->setSkipsDraw(false);
// child layer has 10x10 tiles.
- scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(IntSize(10, 10), LayerTilingData::HasBorderTexels);
+ scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(gfx::Size(10, 10), LayerTilingData::HasBorderTexels);
tiler->setBounds(child->contentBounds());
child->setTilingData(*tiler.get());
- grandChild->setAnchorPoint(FloatPoint(0, 0));
- grandChild->setPosition(IntPoint(grandChildRect.x(), grandChildRect.y()));
- grandChild->setBounds(IntSize(grandChildRect.width(), grandChildRect.height()));
+ grandChild->setAnchorPoint(gfx::PointF(0, 0));
+ grandChild->setPosition(gfx::Point(grandChildRect.x(), grandChildRect.y()));
+ grandChild->setBounds(gfx::Size(grandChildRect.width(), grandChildRect.height()));
grandChild->setContentBounds(grandChild->bounds());
grandChild->setDrawsContent(true);
@@ -3716,7 +3713,7 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithScissor)
EXPECT_TRUE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(childPassId));
// Damage a single tile of surface 2.
- childPtr->setUpdateRect(IntRect(10, 10, 10, 10));
+ childPtr->setUpdateRect(gfx::Rect(10, 10, 10, 10));
{
LayerTreeHostImpl::FrameData frame;
@@ -3734,7 +3731,7 @@ TEST_P(LayerTreeHostImplTest, surfaceTextureCaching)
Settings::setPartialSwapEnabled(true);
LayerTreeSettings settings;
- settings.minimumOcclusionTrackingSize = IntSize();
+ settings.minimumOcclusionTrackingSize = gfx::Size();
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
LayerImpl* rootPtr;
@@ -3742,7 +3739,7 @@ TEST_P(LayerTreeHostImplTest, surfaceTextureCaching)
LayerImpl* surfaceLayerPtr;
LayerImpl* childPtr;
- setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr, surfaceLayerPtr, childPtr, IntSize(100, 100));
+ setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr, surfaceLayerPtr, childPtr, gfx::Size(100, 100));
{
LayerTreeHostImpl::FrameData frame;
@@ -3895,7 +3892,7 @@ TEST_P(LayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap)
Settings::setPartialSwapEnabled(false);
LayerTreeSettings settings;
- settings.minimumOcclusionTrackingSize = IntSize();
+ settings.minimumOcclusionTrackingSize = gfx::Size();
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this);
LayerImpl* rootPtr;
@@ -3903,7 +3900,7 @@ TEST_P(LayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap)
LayerImpl* surfaceLayerPtr;
LayerImpl* childPtr;
- setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr, surfaceLayerPtr, childPtr, IntSize(100, 100));
+ setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr, surfaceLayerPtr, childPtr, gfx::Size(100, 100));
{
LayerTreeHostImpl::FrameData frame;
@@ -4103,7 +4100,7 @@ public:
virtual bool haveCachedResourcesForRenderPassId(RenderPass::Id id) const OVERRIDE { return m_textures.count(id); }
// RendererClient implementation.
- virtual const IntSize& deviceViewportSize() const OVERRIDE { return m_viewportSize; }
+ virtual const gfx::Size& deviceViewportSize() const OVERRIDE { return m_viewportSize; }
virtual const LayerTreeSettings& settings() const OVERRIDE { return m_settings; }
virtual void didLoseContext() OVERRIDE { }
virtual void onSwapBuffersComplete() OVERRIDE { }
@@ -4116,7 +4113,7 @@ protected:
private:
LayerTreeSettings m_settings;
- IntSize m_viewportSize;
+ gfx::Size m_viewportSize;
base::hash_set<RenderPass::Id> m_textures;
};
@@ -4125,13 +4122,13 @@ static void configureRenderPassTestData(const char* testScript, RenderPassRemova
renderer->clearCachedTextures();
// One shared state for all quads - we don't need the correct details
- testData.sharedQuadState = SharedQuadState::create(WebTransformationMatrix(), IntRect(), IntRect(), 1.0, true);
+ testData.sharedQuadState = SharedQuadState::create(WebTransformationMatrix(), gfx::Rect(), gfx::Rect(), 1.0, true);
const char* currentChar = testScript;
// Pre-create root pass
RenderPass::Id rootRenderPassId = RenderPass::Id(testScript[0], testScript[1]);
- testData.renderPassCache.add(rootRenderPassId, TestRenderPass::create(rootRenderPassId, IntRect(), WebTransformationMatrix()));
+ testData.renderPassCache.add(rootRenderPassId, TestRenderPass::create(rootRenderPassId, gfx::Rect(), WebTransformationMatrix()));
while (*currentChar) {
int layerId = *currentChar;
currentChar++;
@@ -4151,7 +4148,7 @@ static void configureRenderPassTestData(const char* testScript, RenderPassRemova
while (*currentChar && *currentChar != '\n') {
if (*currentChar == 's') {
// Solid color draw quad
- scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::create(testData.sharedQuadState.get(), IntRect(0, 0, 10, 10), SK_ColorWHITE);
+ scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::create(testData.sharedQuadState.get(), gfx::Rect(0, 0, 10, 10), SK_ColorWHITE);
renderPass->appendQuad(quad.PassAs<DrawQuad>());
currentChar++;
@@ -4188,11 +4185,11 @@ static void configureRenderPassTestData(const char* testScript, RenderPassRemova
if (hasTexture)
renderer->setHaveCachedResourcesForRenderPassId(newRenderPassId);
- testData.renderPassCache.add(newRenderPassId, TestRenderPass::create(newRenderPassId, IntRect(), WebTransformationMatrix()));
+ testData.renderPassCache.add(newRenderPassId, TestRenderPass::create(newRenderPassId, gfx::Rect(), WebTransformationMatrix()));
}
- IntRect quadRect = IntRect(0, 0, 1, 1);
- IntRect contentsChangedRect = contentsChanged ? quadRect : IntRect();
+ gfx::Rect quadRect = gfx::Rect(0, 0, 1, 1);
+ gfx::Rect contentsChangedRect = contentsChanged ? quadRect : gfx::Rect();
scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::create(testData.sharedQuadState.get(), quadRect, newRenderPassId, isReplica, 1, contentsChangedRect, 1, 1, 0, 0);
renderPass->appendQuad(quad.PassAs<DrawQuad>());
}
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698