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

Unified Diff: cc/resources/resource_provider.cc

Issue 558083002: [cc] Add nearest neighbor filtering for TextureLayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add nearest_neighbor field to TextureMailbox. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/resources/resource_provider.cc
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index 9651ef7939f0e33347b1976d89c308492df08858..3cdb45cf5793e4b2ddd90a46b85fb5117f05c678 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -596,10 +596,10 @@ ResourceProvider::ResourceId ResourceProvider::CreateResourceFromTextureMailbox(
gfx::Size(),
Resource::External,
mailbox.target(),
- GL_LINEAR,
+ mailbox.nearest_neighbor() ? GL_NEAREST : GL_LINEAR,
0,
GL_CLAMP_TO_EDGE,
- TextureHintImmutable,
+ TextureHintDefault,
piman 2014/10/28 05:09:50 Why change this?
jackhou1 2014/10/29 00:12:25 Done.
RGBA_8888);
} else {
DCHECK(mailbox.IsSharedMemory());
@@ -616,7 +616,7 @@ ResourceProvider::ResourceId ResourceProvider::CreateResourceFromTextureMailbox(
shared_bitmap.release(),
mailbox.shared_memory_size(),
Resource::External,
- GL_LINEAR,
+ mailbox.nearest_neighbor() ? GL_NEAREST : GL_LINEAR,
GL_CLAMP_TO_EDGE);
}
resource.allocated = true;
@@ -1335,7 +1335,7 @@ void ResourceProvider::ReceiveFromChild(
resource = Resource(it->mailbox_holder.mailbox,
it->size,
Resource::Delegated,
- GL_LINEAR,
+ it->filter,
it->is_repeated ? GL_REPEAT : GL_CLAMP_TO_EDGE);
} else {
resource = Resource(0,
@@ -1345,7 +1345,7 @@ void ResourceProvider::ReceiveFromChild(
it->filter,
0,
it->is_repeated ? GL_REPEAT : GL_CLAMP_TO_EDGE,
- TextureHintImmutable,
+ TextureHintDefault,
piman 2014/10/28 05:09:50 And this
jackhou1 2014/10/29 00:12:25 Done.
it->format);
resource.mailbox = TextureMailbox(it->mailbox_holder.mailbox,
it->mailbox_holder.texture_target,

Powered by Google App Engine
This is Rietveld 408576698