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

Unified Diff: cc/nine_patch_layer_unittest.cc

Issue 12774006: cc: Chromify Layer and LayerImpl classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MoreAndroidCompilings Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/nine_patch_layer_impl_unittest.cc ('k') | cc/occlusion_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/nine_patch_layer_unittest.cc
diff --git a/cc/nine_patch_layer_unittest.cc b/cc/nine_patch_layer_unittest.cc
index e63263f92749e32862481f8edf607ef3bce004dc..5d1c3f593b21978fef94ce2842d26d133161110b 100644
--- a/cc/nine_patch_layer_unittest.cc
+++ b/cc/nine_patch_layer_unittest.cc
@@ -47,42 +47,42 @@ public:
{
}
- Proxy* proxy() const { return m_layerTreeHost->proxy(); }
+ Proxy* proxy() const { return layer_tree_host_->proxy(); }
protected:
virtual void SetUp()
{
- m_layerTreeHost.reset(new MockLayerTreeHost);
+ layer_tree_host_.reset(new MockLayerTreeHost);
}
virtual void TearDown()
{
- Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
+ Mock::VerifyAndClearExpectations(layer_tree_host_.get());
}
- scoped_ptr<MockLayerTreeHost> m_layerTreeHost;
+ scoped_ptr<MockLayerTreeHost> layer_tree_host_;
};
TEST_F(NinePatchLayerTest, triggerFullUploadOnceWhenChangingBitmap)
{
scoped_refptr<NinePatchLayer> testLayer = NinePatchLayer::Create();
ASSERT_TRUE(testLayer);
- testLayer->setIsDrawable(true);
- testLayer->setBounds(gfx::Size(100, 100));
+ testLayer->SetIsDrawable(true);
+ testLayer->SetBounds(gfx::Size(100, 100));
- m_layerTreeHost->setRootLayer(testLayer);
- Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
- EXPECT_EQ(testLayer->layerTreeHost(), m_layerTreeHost.get());
+ layer_tree_host_->setRootLayer(testLayer);
+ Mock::VerifyAndClearExpectations(layer_tree_host_.get());
+ EXPECT_EQ(testLayer->layer_tree_host(), layer_tree_host_.get());
- m_layerTreeHost->initializeRendererIfNeeded();
+ layer_tree_host_->initializeRendererIfNeeded();
PriorityCalculator calculator;
ResourceUpdateQueue queue;
OcclusionTracker occlusionTracker(gfx::Rect(), false);
// No bitmap set should not trigger any uploads.
- testLayer->setTexturePriorities(calculator);
- testLayer->update(queue, &occlusionTracker, NULL);
+ testLayer->SetTexturePriorities(calculator);
+ testLayer->Update(&queue, &occlusionTracker, NULL);
EXPECT_EQ(queue.fullUploadSize(), 0);
EXPECT_EQ(queue.partialUploadSize(), 0);
@@ -91,16 +91,16 @@ TEST_F(NinePatchLayerTest, triggerFullUploadOnceWhenChangingBitmap)
bitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10);
bitmap.allocPixels();
testLayer->SetBitmap(bitmap, gfx::Rect(5, 5, 1, 1));
- testLayer->setTexturePriorities(calculator);
- testLayer->update(queue, &occlusionTracker, NULL);
+ testLayer->SetTexturePriorities(calculator);
+ testLayer->Update(&queue, &occlusionTracker, NULL);
EXPECT_EQ(queue.fullUploadSize(), 1);
EXPECT_EQ(queue.partialUploadSize(), 0);
ResourceUpdate params = queue.takeFirstFullUpload();
EXPECT_TRUE(params.texture != NULL);
// Upload the texture.
- m_layerTreeHost->contentsTextureManager()->setMaxMemoryLimitBytes(1024 * 1024);
- m_layerTreeHost->contentsTextureManager()->prioritizeTextures();
+ layer_tree_host_->contentsTextureManager()->setMaxMemoryLimitBytes(1024 * 1024);
+ layer_tree_host_->contentsTextureManager()->prioritizeTextures();
scoped_ptr<OutputSurface> outputSurface;
scoped_ptr<ResourceProvider> resourceProvider;
@@ -114,34 +114,34 @@ TEST_F(NinePatchLayerTest, triggerFullUploadOnceWhenChangingBitmap)
}
// Nothing changed, so no repeated upload.
- testLayer->setTexturePriorities(calculator);
- testLayer->update(queue, &occlusionTracker, NULL);
+ testLayer->SetTexturePriorities(calculator);
+ testLayer->Update(&queue, &occlusionTracker, NULL);
EXPECT_EQ(queue.fullUploadSize(), 0);
EXPECT_EQ(queue.partialUploadSize(), 0);
{
DebugScopedSetImplThread implThread(proxy());
DebugScopedSetMainThreadBlocked mainThreadBlocked(proxy());
- m_layerTreeHost->contentsTextureManager()->clearAllMemory(resourceProvider.get());
+ layer_tree_host_->contentsTextureManager()->clearAllMemory(resourceProvider.get());
}
// Reupload after eviction
- testLayer->setTexturePriorities(calculator);
- testLayer->update(queue, &occlusionTracker, NULL);
+ testLayer->SetTexturePriorities(calculator);
+ testLayer->Update(&queue, &occlusionTracker, NULL);
EXPECT_EQ(queue.fullUploadSize(), 1);
EXPECT_EQ(queue.partialUploadSize(), 0);
// PrioritizedResourceManager clearing
- m_layerTreeHost->contentsTextureManager()->unregisterTexture(params.texture);
+ layer_tree_host_->contentsTextureManager()->unregisterTexture(params.texture);
EXPECT_EQ(NULL, params.texture->resourceManager());
- testLayer->setTexturePriorities(calculator);
+ testLayer->SetTexturePriorities(calculator);
ResourceUpdateQueue queue2;
- testLayer->update(queue2, &occlusionTracker, NULL);
+ testLayer->Update(&queue2, &occlusionTracker, NULL);
EXPECT_EQ(queue2.fullUploadSize(), 1);
EXPECT_EQ(queue2.partialUploadSize(), 0);
params = queue2.takeFirstFullUpload();
EXPECT_TRUE(params.texture != NULL);
- EXPECT_EQ(params.texture->resourceManager(), m_layerTreeHost->contentsTextureManager());
+ EXPECT_EQ(params.texture->resourceManager(), layer_tree_host_->contentsTextureManager());
}
} // namespace
« no previous file with comments | « cc/nine_patch_layer_impl_unittest.cc ('k') | cc/occlusion_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698