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

Unified Diff: cc/resources/resource_provider_unittest.cc

Issue 558083002: [cc] Add nearest neighbor filtering for TextureLayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to WebExternalTextureLayer::setNearestNeighbor. Created 6 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
Index: cc/resources/resource_provider_unittest.cc
diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc
index e507ad67a93558d64c805a6edc69db2be348791a..0a358d165798db31c0dfd9b55b0dcb46dbfeb4c3 100644
--- a/cc/resources/resource_provider_unittest.cc
+++ b/cc/resources/resource_provider_unittest.cc
@@ -2648,6 +2648,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_GLTexture2D) {
&main_thread_task_runner));
TextureMailbox mailbox(gpu_mailbox, target, sync_point);
+ mailbox.set_nearest_neighbor(true);
ResourceProvider::ResourceId id =
resource_provider->CreateResourceFromTextureMailbox(
@@ -2663,13 +2664,21 @@ TEST_P(ResourceProviderTest, TextureMailbox_GLTexture2D) {
Mock::VerifyAndClearExpectations(context);
// Using the texture does a consume of the mailbox.
- EXPECT_CALL(*context, bindTexture(target, texture_id));
+ EXPECT_CALL(*context, bindTexture(target, texture_id)).Times(2);
EXPECT_CALL(*context, consumeTextureCHROMIUM(target, _));
EXPECT_CALL(*context, insertSyncPoint()).Times(0);
EXPECT_CALL(*context, produceTextureCHROMIUM(_, _)).Times(0);
- ResourceProvider::ScopedReadLockGL lock(resource_provider.get(), id);
+ // The sampler will reset these because |nearest_neighbor| was set on the
danakj 2014/11/17 17:39:41 It would be nice to test 2 TextureMailboxes, one w
jackhou1 2014/11/17 22:46:35 Refactored this test in a similar way to ResourceP
+ // mailbox.
+ EXPECT_CALL(*context,
+ texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
+ EXPECT_CALL(*context,
+ texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
+
+ ResourceProvider::ScopedSamplerGL lock(
+ resource_provider.get(), id, GL_LINEAR);
Mock::VerifyAndClearExpectations(context);
// When done with it, a sync point should be inserted, but no produce is

Powered by Google App Engine
This is Rietveld 408576698