Index: cc/tiled_layer_unittest.cc |
diff --git a/cc/tiled_layer_unittest.cc b/cc/tiled_layer_unittest.cc |
index 0f45c5a6ab470fb83cd9d44428999920d9315b43..c95ac46d59d21ef0df4d17db427a3f5268bf46b2 100644 |
--- a/cc/tiled_layer_unittest.cc |
+++ b/cc/tiled_layer_unittest.cc |
@@ -27,10 +27,10 @@ using WebKit::WebTransformationMatrix; |
namespace { |
-class TestCCOcclusionTracker : public CCOcclusionTracker { |
+class TestOcclusionTracker : public OcclusionTracker { |
public: |
- TestCCOcclusionTracker() |
- : CCOcclusionTracker(IntRect(0, 0, 1000, 1000), true) |
+ TestOcclusionTracker() |
+ : OcclusionTracker(IntRect(0, 0, 1000, 1000), true) |
, m_layerClipRectInTarget(IntRect(0, 0, 1000, 1000)) |
{ |
// Pretend we have visited a render surface. |
@@ -40,26 +40,26 @@ public: |
void setOcclusion(const Region& occlusion) { m_stack.last().occlusionInScreen = occlusion; } |
protected: |
- virtual IntRect layerClipRectInTarget(const LayerChromium* layer) const OVERRIDE { return m_layerClipRectInTarget; } |
+ virtual IntRect layerClipRectInTarget(const Layer* layer) const OVERRIDE { return m_layerClipRectInTarget; } |
private: |
IntRect m_layerClipRectInTarget; |
}; |
-class TiledLayerChromiumTest : public testing::Test { |
+class TiledLayerTest : public testing::Test { |
public: |
- TiledLayerChromiumTest() |
+ TiledLayerTest() |
: m_compositorInitializer(0) |
- , m_context(WebKit::createFakeCCGraphicsContext()) |
- , m_queue(make_scoped_ptr(new CCTextureUpdateQueue)) |
- , m_textureManager(CCPrioritizedTextureManager::create(60*1024*1024, 1024, CCRenderer::ContentPool)) |
+ , m_context(WebKit::createFakeGraphicsContext()) |
+ , m_queue(make_scoped_ptr(new TextureUpdateQueue)) |
+ , m_textureManager(PrioritizedTextureManager::create(60*1024*1024, 1024, Renderer::ContentPool)) |
, m_occlusion(0) |
{ |
DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; |
- m_resourceProvider = CCResourceProvider::create(m_context.get()); |
+ m_resourceProvider = ResourceProvider::create(m_context.get()); |
} |
- virtual ~TiledLayerChromiumTest() |
+ virtual ~TiledLayerTest() |
{ |
textureManagerClearAllMemory(m_textureManager.get(), m_resourceProvider.get()); |
DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; |
@@ -68,30 +68,30 @@ public: |
// Helper classes and functions that set the current thread to be the impl thread |
// before doing the action that they wrap. |
- class ScopedFakeCCTiledLayerImpl { |
+ class ScopedFakeTiledLayerImpl { |
public: |
- ScopedFakeCCTiledLayerImpl(int id) |
+ ScopedFakeTiledLayerImpl(int id) |
{ |
DebugScopedSetImplThread implThread; |
- m_layerImpl = new FakeCCTiledLayerImpl(id); |
+ m_layerImpl = new FakeTiledLayerImpl(id); |
} |
- ~ScopedFakeCCTiledLayerImpl() |
+ ~ScopedFakeTiledLayerImpl() |
{ |
DebugScopedSetImplThread implThread; |
delete m_layerImpl; |
} |
- FakeCCTiledLayerImpl* get() |
+ FakeTiledLayerImpl* get() |
{ |
return m_layerImpl; |
} |
- FakeCCTiledLayerImpl* operator->() |
+ FakeTiledLayerImpl* operator->() |
{ |
return m_layerImpl; |
} |
private: |
- FakeCCTiledLayerImpl* m_layerImpl; |
+ FakeTiledLayerImpl* m_layerImpl; |
}; |
- void textureManagerClearAllMemory(CCPrioritizedTextureManager* textureManager, CCResourceProvider* resourceProvider) |
+ void textureManagerClearAllMemory(PrioritizedTextureManager* textureManager, ResourceProvider* resourceProvider) |
{ |
DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; |
textureManager->clearAllMemory(resourceProvider); |
@@ -101,31 +101,31 @@ public: |
{ |
DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; |
ASSERT(m_queue); |
- scoped_ptr<CCTextureUpdateController> updateController = |
- CCTextureUpdateController::create( |
+ scoped_ptr<TextureUpdateController> updateController = |
+ TextureUpdateController::create( |
NULL, |
- CCProxy::implThread(), |
+ Proxy::implThread(), |
m_queue.Pass(), |
m_resourceProvider.get(), |
&m_uploader); |
updateController->finalize(); |
- m_queue = make_scoped_ptr(new CCTextureUpdateQueue); |
+ m_queue = make_scoped_ptr(new TextureUpdateQueue); |
} |
- void layerPushPropertiesTo(FakeTiledLayerChromium* layer, FakeCCTiledLayerImpl* layerImpl) |
+ void layerPushPropertiesTo(FakeTiledLayer* layer, FakeTiledLayerImpl* layerImpl) |
{ |
DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; |
layer->pushPropertiesTo(layerImpl); |
} |
- void layerUpdate(FakeTiledLayerChromium* layer, TestCCOcclusionTracker* occluded) |
+ void layerUpdate(FakeTiledLayer* layer, TestOcclusionTracker* occluded) |
{ |
DebugScopedSetMainThread mainThread; |
layer->update(*m_queue.get(), occluded, m_stats); |
} |
- bool updateAndPush(FakeTiledLayerChromium* layer1, |
- FakeCCTiledLayerImpl* layerImpl1, |
- FakeTiledLayerChromium* layer2 = 0, |
- FakeCCTiledLayerImpl* layerImpl2 = 0) |
+ bool updateAndPush(FakeTiledLayer* layer1, |
+ FakeTiledLayerImpl* layerImpl1, |
+ FakeTiledLayer* layer2 = 0, |
+ FakeTiledLayerImpl* layerImpl2 = 0) |
{ |
// Get textures |
m_textureManager->clearPriorities(); |
@@ -159,20 +159,20 @@ public: |
public: |
WebKitTests::WebCompositorInitializer m_compositorInitializer; |
- scoped_ptr<CCGraphicsContext> m_context; |
- scoped_ptr<CCResourceProvider> m_resourceProvider; |
- scoped_ptr<CCTextureUpdateQueue> m_queue; |
- CCRenderingStats m_stats; |
+ scoped_ptr<GraphicsContext> m_context; |
+ scoped_ptr<ResourceProvider> m_resourceProvider; |
+ scoped_ptr<TextureUpdateQueue> m_queue; |
+ RenderingStats m_stats; |
FakeTextureUploader m_uploader; |
- CCPriorityCalculator m_priorityCalculator; |
- scoped_ptr<CCPrioritizedTextureManager> m_textureManager; |
- TestCCOcclusionTracker* m_occlusion; |
+ PriorityCalculator m_priorityCalculator; |
+ scoped_ptr<PrioritizedTextureManager> m_textureManager; |
+ TestOcclusionTracker* m_occlusion; |
}; |
-TEST_F(TiledLayerChromiumTest, pushDirtyTiles) |
+TEST_F(TiledLayerTest, pushDirtyTiles) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
// The tile size is 100x100, so this invalidates and then paints two tiles. |
layer->setBounds(IntSize(100, 200)); |
@@ -195,11 +195,11 @@ TEST_F(TiledLayerChromiumTest, pushDirtyTiles) |
EXPECT_FALSE(layerImpl->hasResourceIdForTileAt(0, 1)); |
} |
-TEST_F(TiledLayerChromiumTest, pushOccludedDirtyTiles) |
+TEST_F(TiledLayerTest, pushOccludedDirtyTiles) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
- TestCCOcclusionTracker occluded; |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
+ TestOcclusionTracker occluded; |
m_occlusion = &occluded; |
// The tile size is 100x100, so this invalidates and then paints two tiles. |
@@ -231,10 +231,10 @@ TEST_F(TiledLayerChromiumTest, pushOccludedDirtyTiles) |
EXPECT_TRUE(layerImpl->hasResourceIdForTileAt(0, 1)); |
} |
-TEST_F(TiledLayerChromiumTest, pushDeletedTiles) |
+TEST_F(TiledLayerTest, pushDeletedTiles) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
// The tile size is 100x100, so this invalidates and then paints two tiles. |
layer->setBounds(IntSize(100, 200)); |
@@ -266,10 +266,10 @@ TEST_F(TiledLayerChromiumTest, pushDeletedTiles) |
EXPECT_FALSE(layerImpl->hasResourceIdForTileAt(0, 1)); |
} |
-TEST_F(TiledLayerChromiumTest, pushIdlePaintTiles) |
+TEST_F(TiledLayerTest, pushIdlePaintTiles) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
// The tile size is 100x100. Setup 5x5 tiles with one visible tile in the center. |
// This paints 1 visible of the 25 invalid tiles. |
@@ -302,14 +302,14 @@ TEST_F(TiledLayerChromiumTest, pushIdlePaintTiles) |
EXPECT_FALSE(needsUpdate); |
} |
-TEST_F(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed) |
+TEST_F(TiledLayerTest, pushTilesAfterIdlePaintFailed) |
{ |
// Start with 2mb of memory, but the test is going to try to use just more than 1mb, so we reduce to 1mb later. |
m_textureManager->setMaxMemoryLimitBytes(2 * 1024 * 1024); |
- scoped_refptr<FakeTiledLayerChromium> layer1 = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layerImpl1(1); |
- scoped_refptr<FakeTiledLayerChromium> layer2 = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layerImpl2(2); |
+ scoped_refptr<FakeTiledLayer> layer1 = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layerImpl1(1); |
+ scoped_refptr<FakeTiledLayer> layer2 = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layerImpl2(2); |
// For this test we have two layers. layer1 exhausts most texture memory, leaving room for 2 more tiles from |
// layer2, but not all three tiles. First we paint layer1, and one tile from layer2. Then when we idle paint |
@@ -356,11 +356,11 @@ TEST_F(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed) |
EXPECT_FALSE(layerImpl2->hasResourceIdForTileAt(0, 2)); |
} |
-TEST_F(TiledLayerChromiumTest, pushIdlePaintedOccludedTiles) |
+TEST_F(TiledLayerTest, pushIdlePaintedOccludedTiles) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
- TestCCOcclusionTracker occluded; |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
+ TestOcclusionTracker occluded; |
m_occlusion = &occluded; |
// The tile size is 100x100, so this invalidates one occluded tile, culls it during paint, but prepaints it. |
@@ -375,10 +375,10 @@ TEST_F(TiledLayerChromiumTest, pushIdlePaintedOccludedTiles) |
EXPECT_EQ(1, occluded.overdrawMetrics().tilesCulledForUpload()); |
} |
-TEST_F(TiledLayerChromiumTest, pushTilesMarkedDirtyDuringPaint) |
+TEST_F(TiledLayerTest, pushTilesMarkedDirtyDuringPaint) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
// The tile size is 100x100, so this invalidates and then paints two tiles. |
// However, during the paint, we invalidate one of the tiles. This should |
@@ -393,12 +393,12 @@ TEST_F(TiledLayerChromiumTest, pushTilesMarkedDirtyDuringPaint) |
EXPECT_TRUE(layerImpl->hasResourceIdForTileAt(0, 1)); |
} |
-TEST_F(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnNextLayer) |
+TEST_F(TiledLayerTest, pushTilesLayerMarkedDirtyDuringPaintOnNextLayer) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer1 = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- scoped_refptr<FakeTiledLayerChromium> layer2 = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layer1Impl(1); |
- ScopedFakeCCTiledLayerImpl layer2Impl(2); |
+ scoped_refptr<FakeTiledLayer> layer1 = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ scoped_refptr<FakeTiledLayer> layer2 = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layer1Impl(1); |
+ ScopedFakeTiledLayerImpl layer2Impl(2); |
// Invalidate a tile on layer1, during update of layer 2. |
layer2->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer1.get()); |
@@ -416,12 +416,12 @@ TEST_F(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnNextLayer) |
EXPECT_TRUE(layer2Impl->hasResourceIdForTileAt(0, 1)); |
} |
-TEST_F(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnPreviousLayer) |
+TEST_F(TiledLayerTest, pushTilesLayerMarkedDirtyDuringPaintOnPreviousLayer) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer1 = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- scoped_refptr<FakeTiledLayerChromium> layer2 = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layer1Impl(1); |
- ScopedFakeCCTiledLayerImpl layer2Impl(2); |
+ scoped_refptr<FakeTiledLayer> layer1 = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ scoped_refptr<FakeTiledLayer> layer2 = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layer1Impl(1); |
+ ScopedFakeTiledLayerImpl layer2Impl(2); |
layer1->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer2.get()); |
layer1->setBounds(IntSize(100, 200)); |
@@ -438,21 +438,21 @@ TEST_F(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnPreviousLay |
EXPECT_TRUE(layer2Impl->hasResourceIdForTileAt(0, 1)); |
} |
-TEST_F(TiledLayerChromiumTest, paintSmallAnimatedLayersImmediately) |
+TEST_F(TiledLayerTest, paintSmallAnimatedLayersImmediately) |
{ |
- // Create a CCLayerTreeHost that has the right viewportsize, |
+ // Create a LayerTreeHost that has the right viewportsize, |
// so the layer is considered small enough. |
- FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient; |
- scoped_ptr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, CCLayerTreeSettings()); |
+ FakeLayerImplTreeHostClient fakeLayerImplTreeHostClient; |
+ scoped_ptr<LayerTreeHost> layerTreeHost = LayerTreeHost::create(&fakeLayerImplTreeHostClient, LayerTreeSettings()); |
bool runOutOfMemory[2] = {false, true}; |
for (int i = 0; i < 2; i++) { |
// Create a layer with 4x4 tiles. |
- int layerWidth = 4 * FakeTiledLayerChromium::tileSize().width(); |
- int layerHeight = 4 * FakeTiledLayerChromium::tileSize().height(); |
+ int layerWidth = 4 * FakeTiledLayer::tileSize().width(); |
+ int layerHeight = 4 * FakeTiledLayer::tileSize().height(); |
int memoryForLayer = layerWidth * layerHeight * 4; |
IntSize viewportSize = IntSize(layerWidth, layerHeight); |
- ccLayerTreeHost->setViewportSize(viewportSize, viewportSize); |
+ layerTreeHost->setViewportSize(viewportSize, viewportSize); |
// Use 8x4 tiles to run out of memory. |
if (runOutOfMemory[i]) |
@@ -460,8 +460,8 @@ TEST_F(TiledLayerChromiumTest, paintSmallAnimatedLayersImmediately) |
m_textureManager->setMaxMemoryLimitBytes(memoryForLayer); |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
// Full size layer with half being visible. |
IntSize contentBounds(layerWidth, layerHeight); |
@@ -473,7 +473,7 @@ TEST_F(TiledLayerChromiumTest, paintSmallAnimatedLayersImmediately) |
layer->setBounds(contentBounds); |
layer->setVisibleContentRect(visibleRect); |
layer->invalidateContentRect(contentRect); |
- layer->setLayerTreeHost(ccLayerTreeHost.get()); |
+ layer->setLayerTreeHost(layerTreeHost.get()); |
// The layer should paint it's entire contents on the first paint |
// if it is close to the viewport size and has the available memory. |
@@ -500,10 +500,10 @@ TEST_F(TiledLayerChromiumTest, paintSmallAnimatedLayersImmediately) |
} |
} |
-TEST_F(TiledLayerChromiumTest, idlePaintOutOfMemory) |
+TEST_F(TiledLayerTest, idlePaintOutOfMemory) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
// We have enough memory for only the visible rect, so we will run out of memory in first idle paint. |
int memoryLimit = 4 * 100 * 100; // 1 tiles, 4 bytes per pixel. |
@@ -523,10 +523,10 @@ TEST_F(TiledLayerChromiumTest, idlePaintOutOfMemory) |
EXPECT_TRUE(layerImpl->hasResourceIdForTileAt(1, 1)); |
} |
-TEST_F(TiledLayerChromiumTest, idlePaintZeroSizedLayer) |
+TEST_F(TiledLayerTest, idlePaintZeroSizedLayer) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
bool animating[2] = {false, true}; |
for (int i = 0; i < 2; i++) { |
@@ -550,10 +550,10 @@ TEST_F(TiledLayerChromiumTest, idlePaintZeroSizedLayer) |
} |
} |
-TEST_F(TiledLayerChromiumTest, idlePaintNonVisibleLayers) |
+TEST_F(TiledLayerTest, idlePaintNonVisibleLayers) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
// Alternate between not visible and visible. |
IntRect v(0, 0, 100, 100); |
@@ -580,10 +580,10 @@ TEST_F(TiledLayerChromiumTest, idlePaintNonVisibleLayers) |
} |
} |
-TEST_F(TiledLayerChromiumTest, invalidateFromPrepare) |
+TEST_F(TiledLayerTest, invalidateFromPrepare) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
// The tile size is 100x100, so this invalidates and then paints two tiles. |
layer->setBounds(IntSize(100, 200)); |
@@ -613,7 +613,7 @@ TEST_F(TiledLayerChromiumTest, invalidateFromPrepare) |
EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount()); |
} |
-TEST_F(TiledLayerChromiumTest, verifyUpdateRectWhenContentBoundsAreScaled) |
+TEST_F(TiledLayerTest, verifyUpdateRectWhenContentBoundsAreScaled) |
{ |
// The updateRect (that indicates what was actually painted) should be in |
// layer space, not the content space. |
@@ -653,10 +653,10 @@ TEST_F(TiledLayerChromiumTest, verifyUpdateRectWhenContentBoundsAreScaled) |
EXPECT_FLOAT_RECT_EQ(FloatRect(45, 80, 15, 8), layer->updateRect()); |
} |
-TEST_F(TiledLayerChromiumTest, verifyInvalidationWhenContentsScaleChanges) |
+TEST_F(TiledLayerTest, verifyInvalidationWhenContentsScaleChanges) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
// Create a layer with one tile. |
layer->setBounds(IntSize(100, 100)); |
@@ -707,11 +707,11 @@ TEST_F(TiledLayerChromiumTest, verifyInvalidationWhenContentsScaleChanges) |
EXPECT_FALSE(layerImpl->hasResourceIdForTileAt(1, 1)); |
} |
-TEST_F(TiledLayerChromiumTest, skipsDrawGetsReset) |
+TEST_F(TiledLayerTest, skipsDrawGetsReset) |
{ |
- FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient; |
- scoped_ptr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, CCLayerTreeSettings()); |
- ASSERT_TRUE(ccLayerTreeHost->initializeRendererIfNeeded()); |
+ FakeLayerImplTreeHostClient fakeLayerImplTreeHostClient; |
+ scoped_ptr<LayerTreeHost> layerTreeHost = LayerTreeHost::create(&fakeLayerImplTreeHostClient, LayerTreeSettings()); |
+ ASSERT_TRUE(layerTreeHost->initializeRendererIfNeeded()); |
// Create two 300 x 300 tiled layers. |
IntSize contentBounds(300, 300); |
@@ -720,8 +720,8 @@ TEST_F(TiledLayerChromiumTest, skipsDrawGetsReset) |
// We have enough memory for only one of the two layers. |
int memoryLimit = 4 * 300 * 300; // 4 bytes per pixel. |
- scoped_refptr<FakeTiledLayerChromium> rootLayer = make_scoped_refptr(new FakeTiledLayerChromium(ccLayerTreeHost->contentsTextureManager())); |
- scoped_refptr<FakeTiledLayerChromium> childLayer = make_scoped_refptr(new FakeTiledLayerChromium(ccLayerTreeHost->contentsTextureManager())); |
+ scoped_refptr<FakeTiledLayer> rootLayer = make_scoped_refptr(new FakeTiledLayer(layerTreeHost->contentsTextureManager())); |
+ scoped_refptr<FakeTiledLayer> childLayer = make_scoped_refptr(new FakeTiledLayer(layerTreeHost->contentsTextureManager())); |
rootLayer->addChild(childLayer); |
rootLayer->setBounds(contentBounds); |
@@ -733,30 +733,30 @@ TEST_F(TiledLayerChromiumTest, skipsDrawGetsReset) |
rootLayer->invalidateContentRect(contentRect); |
childLayer->invalidateContentRect(contentRect); |
- ccLayerTreeHost->setRootLayer(rootLayer); |
- ccLayerTreeHost->setViewportSize(IntSize(300, 300), IntSize(300, 300)); |
+ layerTreeHost->setRootLayer(rootLayer); |
+ layerTreeHost->setViewportSize(IntSize(300, 300), IntSize(300, 300)); |
- ccLayerTreeHost->updateLayers(*m_queue.get(), memoryLimit); |
+ layerTreeHost->updateLayers(*m_queue.get(), memoryLimit); |
// We'll skip the root layer. |
EXPECT_TRUE(rootLayer->skipsDraw()); |
EXPECT_FALSE(childLayer->skipsDraw()); |
- ccLayerTreeHost->commitComplete(); |
+ layerTreeHost->commitComplete(); |
// Remove the child layer. |
rootLayer->removeAllChildren(); |
- ccLayerTreeHost->updateLayers(*m_queue.get(), memoryLimit); |
+ layerTreeHost->updateLayers(*m_queue.get(), memoryLimit); |
EXPECT_FALSE(rootLayer->skipsDraw()); |
- textureManagerClearAllMemory(ccLayerTreeHost->contentsTextureManager(), m_resourceProvider.get()); |
- ccLayerTreeHost->setRootLayer(0); |
+ textureManagerClearAllMemory(layerTreeHost->contentsTextureManager(), m_resourceProvider.get()); |
+ layerTreeHost->setRootLayer(0); |
} |
-TEST_F(TiledLayerChromiumTest, resizeToSmaller) |
+TEST_F(TiledLayerTest, resizeToSmaller) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
layer->setBounds(IntSize(700, 700)); |
layer->setVisibleContentRect(IntRect(0, 0, 700, 700)); |
@@ -770,9 +770,9 @@ TEST_F(TiledLayerChromiumTest, resizeToSmaller) |
layer->invalidateContentRect(IntRect(0, 0, 200, 200)); |
} |
-TEST_F(TiledLayerChromiumTest, hugeLayerUpdateCrash) |
+TEST_F(TiledLayerTest, hugeLayerUpdateCrash) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
int size = 1 << 30; |
layer->setBounds(IntSize(size, size)); |
@@ -785,33 +785,33 @@ TEST_F(TiledLayerChromiumTest, hugeLayerUpdateCrash) |
layer->update(*m_queue.get(), 0, m_stats); |
} |
-TEST_F(TiledLayerChromiumTest, partialUpdates) |
+TEST_F(TiledLayerTest, partialUpdates) |
{ |
- CCLayerTreeSettings settings; |
+ LayerTreeSettings settings; |
settings.maxPartialTextureUpdates = 4; |
- FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient; |
- scoped_ptr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, settings); |
- ASSERT_TRUE(ccLayerTreeHost->initializeRendererIfNeeded()); |
+ FakeLayerImplTreeHostClient fakeLayerImplTreeHostClient; |
+ scoped_ptr<LayerTreeHost> layerTreeHost = LayerTreeHost::create(&fakeLayerImplTreeHostClient, settings); |
+ ASSERT_TRUE(layerTreeHost->initializeRendererIfNeeded()); |
// Create one 300 x 200 tiled layer with 3 x 2 tiles. |
IntSize contentBounds(300, 200); |
IntRect contentRect(IntPoint::zero(), contentBounds); |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(ccLayerTreeHost->contentsTextureManager())); |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(layerTreeHost->contentsTextureManager())); |
layer->setBounds(contentBounds); |
layer->setPosition(FloatPoint(0, 0)); |
layer->setVisibleContentRect(contentRect); |
layer->invalidateContentRect(contentRect); |
- ccLayerTreeHost->setRootLayer(layer); |
- ccLayerTreeHost->setViewportSize(IntSize(300, 200), IntSize(300, 200)); |
+ layerTreeHost->setRootLayer(layer); |
+ layerTreeHost->setViewportSize(IntSize(300, 200), IntSize(300, 200)); |
// Full update of all 6 tiles. |
- ccLayerTreeHost->updateLayers( |
+ layerTreeHost->updateLayers( |
*m_queue.get(), std::numeric_limits<size_t>::max()); |
{ |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
EXPECT_EQ(6, m_queue->fullUploadSize()); |
EXPECT_EQ(0, m_queue->partialUploadSize()); |
updateTextures(); |
@@ -820,13 +820,13 @@ TEST_F(TiledLayerChromiumTest, partialUpdates) |
layer->fakeLayerTextureUpdater()->clearUpdateCount(); |
layerPushPropertiesTo(layer.get(), layerImpl.get()); |
} |
- ccLayerTreeHost->commitComplete(); |
+ layerTreeHost->commitComplete(); |
// Full update of 3 tiles and partial update of 3 tiles. |
layer->invalidateContentRect(IntRect(0, 0, 300, 150)); |
- ccLayerTreeHost->updateLayers(*m_queue.get(), std::numeric_limits<size_t>::max()); |
+ layerTreeHost->updateLayers(*m_queue.get(), std::numeric_limits<size_t>::max()); |
{ |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
EXPECT_EQ(3, m_queue->fullUploadSize()); |
EXPECT_EQ(3, m_queue->partialUploadSize()); |
updateTextures(); |
@@ -835,13 +835,13 @@ TEST_F(TiledLayerChromiumTest, partialUpdates) |
layer->fakeLayerTextureUpdater()->clearUpdateCount(); |
layerPushPropertiesTo(layer.get(), layerImpl.get()); |
} |
- ccLayerTreeHost->commitComplete(); |
+ layerTreeHost->commitComplete(); |
// Partial update of 6 tiles. |
layer->invalidateContentRect(IntRect(50, 50, 200, 100)); |
{ |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
- ccLayerTreeHost->updateLayers(*m_queue.get(), std::numeric_limits<size_t>::max()); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
+ layerTreeHost->updateLayers(*m_queue.get(), std::numeric_limits<size_t>::max()); |
EXPECT_EQ(2, m_queue->fullUploadSize()); |
EXPECT_EQ(4, m_queue->partialUploadSize()); |
updateTextures(); |
@@ -850,21 +850,21 @@ TEST_F(TiledLayerChromiumTest, partialUpdates) |
layer->fakeLayerTextureUpdater()->clearUpdateCount(); |
layerPushPropertiesTo(layer.get(), layerImpl.get()); |
} |
- ccLayerTreeHost->commitComplete(); |
+ layerTreeHost->commitComplete(); |
// Checkerboard all tiles. |
layer->invalidateContentRect(IntRect(0, 0, 300, 200)); |
{ |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
layerPushPropertiesTo(layer.get(), layerImpl.get()); |
} |
- ccLayerTreeHost->commitComplete(); |
+ layerTreeHost->commitComplete(); |
// Partial update of 6 checkerboard tiles. |
layer->invalidateContentRect(IntRect(50, 50, 200, 100)); |
{ |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
- ccLayerTreeHost->updateLayers(*m_queue.get(), std::numeric_limits<size_t>::max()); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
+ layerTreeHost->updateLayers(*m_queue.get(), std::numeric_limits<size_t>::max()); |
EXPECT_EQ(6, m_queue->fullUploadSize()); |
EXPECT_EQ(0, m_queue->partialUploadSize()); |
updateTextures(); |
@@ -873,13 +873,13 @@ TEST_F(TiledLayerChromiumTest, partialUpdates) |
layer->fakeLayerTextureUpdater()->clearUpdateCount(); |
layerPushPropertiesTo(layer.get(), layerImpl.get()); |
} |
- ccLayerTreeHost->commitComplete(); |
+ layerTreeHost->commitComplete(); |
// Partial update of 4 tiles. |
layer->invalidateContentRect(IntRect(50, 50, 100, 100)); |
{ |
- ScopedFakeCCTiledLayerImpl layerImpl(1); |
- ccLayerTreeHost->updateLayers(*m_queue.get(), std::numeric_limits<size_t>::max()); |
+ ScopedFakeTiledLayerImpl layerImpl(1); |
+ layerTreeHost->updateLayers(*m_queue.get(), std::numeric_limits<size_t>::max()); |
EXPECT_EQ(0, m_queue->fullUploadSize()); |
EXPECT_EQ(4, m_queue->partialUploadSize()); |
updateTextures(); |
@@ -888,15 +888,15 @@ TEST_F(TiledLayerChromiumTest, partialUpdates) |
layer->fakeLayerTextureUpdater()->clearUpdateCount(); |
layerPushPropertiesTo(layer.get(), layerImpl.get()); |
} |
- ccLayerTreeHost->commitComplete(); |
+ layerTreeHost->commitComplete(); |
- textureManagerClearAllMemory(ccLayerTreeHost->contentsTextureManager(), m_resourceProvider.get()); |
- ccLayerTreeHost->setRootLayer(0); |
+ textureManagerClearAllMemory(layerTreeHost->contentsTextureManager(), m_resourceProvider.get()); |
+ layerTreeHost->setRootLayer(0); |
} |
-TEST_F(TiledLayerChromiumTest, tilesPaintedWithoutOcclusion) |
+TEST_F(TiledLayerTest, tilesPaintedWithoutOcclusion) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
// The tile size is 100x100, so this invalidates and then paints two tiles. |
layer->setBounds(IntSize(100, 200)); |
@@ -910,10 +910,10 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithoutOcclusion) |
EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->updateCount()); |
} |
-TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusion) |
+TEST_F(TiledLayerTest, tilesPaintedWithOcclusion) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- TestCCOcclusionTracker occluded; |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ TestOcclusionTracker occluded; |
// The tile size is 100x100. |
@@ -960,10 +960,10 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusion) |
EXPECT_EQ(3 + 2, occluded.overdrawMetrics().tilesCulledForUpload()); |
} |
-TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndVisiblityConstraints) |
+TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndVisiblityConstraints) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- TestCCOcclusionTracker occluded; |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ TestOcclusionTracker occluded; |
// The tile size is 100x100. |
@@ -1018,10 +1018,10 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndVisiblityConstraints) |
} |
-TEST_F(TiledLayerChromiumTest, tilesNotPaintedWithoutInvalidation) |
+TEST_F(TiledLayerTest, tilesNotPaintedWithoutInvalidation) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- TestCCOcclusionTracker occluded; |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ TestOcclusionTracker occluded; |
// The tile size is 100x100. |
@@ -1056,10 +1056,10 @@ TEST_F(TiledLayerChromiumTest, tilesNotPaintedWithoutInvalidation) |
EXPECT_EQ(6, occluded.overdrawMetrics().tilesCulledForUpload()); |
} |
-TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndTransforms) |
+TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndTransforms) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- TestCCOcclusionTracker occluded; |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ TestOcclusionTracker occluded; |
// The tile size is 100x100. |
@@ -1085,10 +1085,10 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndTransforms) |
EXPECT_EQ(3, occluded.overdrawMetrics().tilesCulledForUpload()); |
} |
-TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling) |
+TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndScaling) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- TestCCOcclusionTracker occluded; |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ TestOcclusionTracker occluded; |
// The tile size is 100x100. |
@@ -1158,10 +1158,10 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling) |
EXPECT_EQ(1 + 1, occluded.overdrawMetrics().tilesCulledForUpload()); |
} |
-TEST_F(TiledLayerChromiumTest, visibleContentOpaqueRegion) |
+TEST_F(TiledLayerTest, visibleContentOpaqueRegion) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- TestCCOcclusionTracker occluded; |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ TestOcclusionTracker occluded; |
// The tile size is 100x100, so this invalidates and then paints two tiles in various ways. |
@@ -1250,10 +1250,10 @@ TEST_F(TiledLayerChromiumTest, visibleContentOpaqueRegion) |
EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload()); |
} |
-TEST_F(TiledLayerChromiumTest, pixelsPaintedMetrics) |
+TEST_F(TiledLayerTest, pixelsPaintedMetrics) |
{ |
- scoped_refptr<FakeTiledLayerChromium> layer = make_scoped_refptr(new FakeTiledLayerChromium(m_textureManager.get())); |
- TestCCOcclusionTracker occluded; |
+ scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(new FakeTiledLayer(m_textureManager.get())); |
+ TestOcclusionTracker occluded; |
// The tile size is 100x100, so this invalidates and then paints two tiles in various ways. |
@@ -1302,22 +1302,22 @@ TEST_F(TiledLayerChromiumTest, pixelsPaintedMetrics) |
EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload()); |
} |
-TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAllocated) |
+TEST_F(TiledLayerTest, dontAllocateContentsWhenTargetSurfaceCantBeAllocated) |
{ |
// Tile size is 100x100. |
IntRect rootRect(0, 0, 300, 200); |
IntRect childRect(0, 0, 300, 100); |
IntRect child2Rect(0, 100, 300, 100); |
- CCLayerTreeSettings settings; |
- FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient; |
- scoped_ptr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, settings); |
- ASSERT_TRUE(ccLayerTreeHost->initializeRendererIfNeeded()); |
+ LayerTreeSettings settings; |
+ FakeLayerImplTreeHostClient fakeLayerImplTreeHostClient; |
+ scoped_ptr<LayerTreeHost> layerTreeHost = LayerTreeHost::create(&fakeLayerImplTreeHostClient, settings); |
+ ASSERT_TRUE(layerTreeHost->initializeRendererIfNeeded()); |
- scoped_refptr<FakeTiledLayerChromium> root = make_scoped_refptr(new FakeTiledLayerChromium(ccLayerTreeHost->contentsTextureManager())); |
- scoped_refptr<LayerChromium> surface = LayerChromium::create(); |
- scoped_refptr<FakeTiledLayerChromium> child = make_scoped_refptr(new FakeTiledLayerChromium(ccLayerTreeHost->contentsTextureManager())); |
- scoped_refptr<FakeTiledLayerChromium> child2 = make_scoped_refptr(new FakeTiledLayerChromium(ccLayerTreeHost->contentsTextureManager())); |
+ scoped_refptr<FakeTiledLayer> root = make_scoped_refptr(new FakeTiledLayer(layerTreeHost->contentsTextureManager())); |
+ scoped_refptr<Layer> surface = Layer::create(); |
+ scoped_refptr<FakeTiledLayer> child = make_scoped_refptr(new FakeTiledLayer(layerTreeHost->contentsTextureManager())); |
+ scoped_refptr<FakeTiledLayer> child2 = make_scoped_refptr(new FakeTiledLayer(layerTreeHost->contentsTextureManager())); |
root->setBounds(rootRect.size()); |
root->setAnchorPoint(FloatPoint()); |
@@ -1343,14 +1343,14 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca |
child2->setVisibleContentRect(child2Rect); |
child2->setDrawableContentRect(rootRect); |
- ccLayerTreeHost->setRootLayer(root); |
- ccLayerTreeHost->setViewportSize(rootRect.size(), rootRect.size()); |
+ layerTreeHost->setRootLayer(root); |
+ layerTreeHost->setViewportSize(rootRect.size(), rootRect.size()); |
// With a huge memory limit, all layers should update and push their textures. |
root->invalidateContentRect(rootRect); |
child->invalidateContentRect(childRect); |
child2->invalidateContentRect(child2Rect); |
- ccLayerTreeHost->updateLayers( |
+ layerTreeHost->updateLayers( |
*m_queue.get(), std::numeric_limits<size_t>::max()); |
{ |
updateTextures(); |
@@ -1363,9 +1363,9 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca |
child->fakeLayerTextureUpdater()->clearUpdateCount(); |
child2->fakeLayerTextureUpdater()->clearUpdateCount(); |
- ScopedFakeCCTiledLayerImpl rootImpl(root->id()); |
- ScopedFakeCCTiledLayerImpl childImpl(child->id()); |
- ScopedFakeCCTiledLayerImpl child2Impl(child2->id()); |
+ ScopedFakeTiledLayerImpl rootImpl(root->id()); |
+ ScopedFakeTiledLayerImpl childImpl(child->id()); |
+ ScopedFakeTiledLayerImpl child2Impl(child2->id()); |
layerPushPropertiesTo(root.get(), rootImpl.get()); |
layerPushPropertiesTo(child.get(), childImpl.get()); |
layerPushPropertiesTo(child2.get(), child2Impl.get()); |
@@ -1377,7 +1377,7 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca |
EXPECT_TRUE(child2Impl->hasResourceIdForTileAt(i, 0)); |
} |
} |
- ccLayerTreeHost->commitComplete(); |
+ layerTreeHost->commitComplete(); |
// With a memory limit that includes only the root layer (3x2 tiles) and half the surface that |
// the child layers draw into, the child layers will not be allocated. If the surface isn't |
@@ -1385,7 +1385,7 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca |
root->invalidateContentRect(rootRect); |
child->invalidateContentRect(childRect); |
child2->invalidateContentRect(child2Rect); |
- ccLayerTreeHost->updateLayers( |
+ layerTreeHost->updateLayers( |
*m_queue.get(), (3 * 2 + 3 * 1) * (100 * 100) * 4); |
{ |
updateTextures(); |
@@ -1398,9 +1398,9 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca |
child->fakeLayerTextureUpdater()->clearUpdateCount(); |
child2->fakeLayerTextureUpdater()->clearUpdateCount(); |
- ScopedFakeCCTiledLayerImpl rootImpl(root->id()); |
- ScopedFakeCCTiledLayerImpl childImpl(child->id()); |
- ScopedFakeCCTiledLayerImpl child2Impl(child2->id()); |
+ ScopedFakeTiledLayerImpl rootImpl(root->id()); |
+ ScopedFakeTiledLayerImpl childImpl(child->id()); |
+ ScopedFakeTiledLayerImpl child2Impl(child2->id()); |
layerPushPropertiesTo(root.get(), rootImpl.get()); |
layerPushPropertiesTo(child.get(), childImpl.get()); |
layerPushPropertiesTo(child2.get(), child2Impl.get()); |
@@ -1412,7 +1412,7 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca |
EXPECT_FALSE(child2Impl->hasResourceIdForTileAt(i, 0)); |
} |
} |
- ccLayerTreeHost->commitComplete(); |
+ layerTreeHost->commitComplete(); |
// With a memory limit that includes only half the root layer, no contents will be |
// allocated. If render surface memory wasn't accounted for, there is enough space |
@@ -1421,7 +1421,7 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca |
root->invalidateContentRect(rootRect); |
child->invalidateContentRect(childRect); |
child2->invalidateContentRect(child2Rect); |
- ccLayerTreeHost->updateLayers( |
+ layerTreeHost->updateLayers( |
*m_queue.get(), (3 * 1) * (100 * 100) * 4); |
{ |
updateTextures(); |
@@ -1434,9 +1434,9 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca |
child->fakeLayerTextureUpdater()->clearUpdateCount(); |
child2->fakeLayerTextureUpdater()->clearUpdateCount(); |
- ScopedFakeCCTiledLayerImpl rootImpl(root->id()); |
- ScopedFakeCCTiledLayerImpl childImpl(child->id()); |
- ScopedFakeCCTiledLayerImpl child2Impl(child2->id()); |
+ ScopedFakeTiledLayerImpl rootImpl(root->id()); |
+ ScopedFakeTiledLayerImpl childImpl(child->id()); |
+ ScopedFakeTiledLayerImpl child2Impl(child2->id()); |
layerPushPropertiesTo(root.get(), rootImpl.get()); |
layerPushPropertiesTo(child.get(), childImpl.get()); |
layerPushPropertiesTo(child2.get(), child2Impl.get()); |
@@ -1448,13 +1448,13 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca |
EXPECT_FALSE(child2Impl->hasResourceIdForTileAt(i, 0)); |
} |
} |
- ccLayerTreeHost->commitComplete(); |
+ layerTreeHost->commitComplete(); |
- textureManagerClearAllMemory(ccLayerTreeHost->contentsTextureManager(), m_resourceProvider.get()); |
- ccLayerTreeHost->setRootLayer(0); |
+ textureManagerClearAllMemory(layerTreeHost->contentsTextureManager(), m_resourceProvider.get()); |
+ layerTreeHost->setRootLayer(0); |
} |
-class TrackingLayerPainter : public LayerPainterChromium { |
+class TrackingLayerPainter : public LayerPainter { |
public: |
static scoped_ptr<TrackingLayerPainter> create() { return make_scoped_ptr(new TrackingLayerPainter()); } |
@@ -1472,20 +1472,20 @@ private: |
IntRect m_paintedRect; |
}; |
-class UpdateTrackingTiledLayerChromium : public FakeTiledLayerChromium { |
+class UpdateTrackingTiledLayer : public FakeTiledLayer { |
public: |
- explicit UpdateTrackingTiledLayerChromium(CCPrioritizedTextureManager* manager) |
- : FakeTiledLayerChromium(manager) |
+ explicit UpdateTrackingTiledLayer(PrioritizedTextureManager* manager) |
+ : FakeTiledLayer(manager) |
{ |
scoped_ptr<TrackingLayerPainter> trackingLayerPainter(TrackingLayerPainter::create()); |
m_trackingLayerPainter = trackingLayerPainter.get(); |
- m_layerTextureUpdater = BitmapCanvasLayerTextureUpdater::create(trackingLayerPainter.PassAs<LayerPainterChromium>()); |
+ m_layerTextureUpdater = BitmapCanvasLayerTextureUpdater::create(trackingLayerPainter.PassAs<LayerPainter>()); |
} |
TrackingLayerPainter* trackingLayerPainter() const { return m_trackingLayerPainter; } |
protected: |
- virtual ~UpdateTrackingTiledLayerChromium() { } |
+ virtual ~UpdateTrackingTiledLayer() { } |
virtual LayerTextureUpdater* textureUpdater() const OVERRIDE { return m_layerTextureUpdater.get(); } |
@@ -1494,9 +1494,9 @@ private: |
scoped_refptr<BitmapCanvasLayerTextureUpdater> m_layerTextureUpdater; |
}; |
-TEST_F(TiledLayerChromiumTest, nonIntegerContentsScaleIsNotDistortedDuringPaint) |
+TEST_F(TiledLayerTest, nonIntegerContentsScaleIsNotDistortedDuringPaint) |
{ |
- scoped_refptr<UpdateTrackingTiledLayerChromium> layer = make_scoped_refptr(new UpdateTrackingTiledLayerChromium(m_textureManager.get())); |
+ scoped_refptr<UpdateTrackingTiledLayer> layer = make_scoped_refptr(new UpdateTrackingTiledLayer(m_textureManager.get())); |
IntRect layerRect(0, 0, 30, 31); |
layer->setPosition(layerRect.location()); |
@@ -1525,9 +1525,9 @@ TEST_F(TiledLayerChromiumTest, nonIntegerContentsScaleIsNotDistortedDuringPaint) |
EXPECT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect()); |
} |
-TEST_F(TiledLayerChromiumTest, nonIntegerContentsScaleIsNotDistortedDuringInvalidation) |
+TEST_F(TiledLayerTest, nonIntegerContentsScaleIsNotDistortedDuringInvalidation) |
{ |
- scoped_refptr<UpdateTrackingTiledLayerChromium> layer = make_scoped_refptr(new UpdateTrackingTiledLayerChromium(m_textureManager.get())); |
+ scoped_refptr<UpdateTrackingTiledLayer> layer = make_scoped_refptr(new UpdateTrackingTiledLayer(m_textureManager.get())); |
IntRect layerRect(0, 0, 30, 31); |
layer->setPosition(layerRect.location()); |