summaryrefslogtreecommitdiffstats
path: root/cc/resource_provider.cc
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-13 21:48:42 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-13 21:48:42 +0000
commit0457b750e0029599ef7bf8c470e120dda025fec2 (patch)
tree2a07f56243019f1375d3d790ad34e464e4cc4169 /cc/resource_provider.cc
parente2187871e38b3a119771c1f30664a8cd7bffed5f (diff)
downloadchromium_src-0457b750e0029599ef7bf8c470e120dda025fec2.zip
chromium_src-0457b750e0029599ef7bf8c470e120dda025fec2.tar.gz
chromium_src-0457b750e0029599ef7bf8c470e120dda025fec2.tar.bz2
Avoid redundantly setting tex parameters
BUG= Review URL: https://chromiumcodereview.appspot.com/11366199 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resource_provider.cc')
-rw-r--r--cc/resource_provider.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/cc/resource_provider.cc b/cc/resource_provider.cc
index 0107e82..4269b81 100644
--- a/cc/resource_provider.cc
+++ b/cc/resource_provider.cc
@@ -188,7 +188,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;