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

Unified Diff: cc/resource_provider.cc

Issue 11366199: Avoid redundantly setting tex parameters (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removes now-dead textureFilter code, tests that we don't call texParameteri during draw 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_unittest.cc ('k') | cc/software_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resource_provider.cc
diff --git a/cc/resource_provider.cc b/cc/resource_provider.cc
index d60d66413d2fb8a2ebd38a733456130dc1910965..a497376f7190bad825539b4ddbda7c6f547a1d13 100644
--- a/cc/resource_provider.cc
+++ b/cc/resource_provider.cc
@@ -197,7 +197,15 @@ ResourceProvider::ResourceId ResourceProvider::createBitmap(int pool, const gfx:
ResourceProvider::ResourceId ResourceProvider::createResourceFromExternalTexture(unsigned textureId)
{
DCHECK(m_threadChecker.CalledOnValidThread());
- DCHECK(m_context->context3D());
+
+ WebGraphicsContext3D* context3d = m_context->context3D();
+ DCHECK(context3d);
+ GLC(context3d, context3d->bindTexture(GL_TEXTURE_2D, textureId));
+ GLC(context3d, context3d->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
+ GLC(context3d, context3d->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
+ GLC(context3d, context3d->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
+ GLC(context3d, context3d->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
+
ResourceId id = m_nextId++;
Resource resource(textureId, 0, gfx::Size(), 0);
resource.external = true;
« no previous file with comments | « cc/layer_tree_host_impl_unittest.cc ('k') | cc/software_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698