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

Side by Side Diff: src/gpu/gl/GrGpuGL.cpp

Issue 20362002: make the filter mode for GrTextureAccess an enum so we can plumb down (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fall back to mipmaps for HQ sampling (for now) Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/effects/GrTextureDomainEffect.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "GrGpuGL.h" 9 #include "GrGpuGL.h"
10 #include "GrGLStencilBuffer.h" 10 #include "GrGLStencilBuffer.h"
(...skipping 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 this->setTextureUnit(unitIdx); 1999 this->setTextureUnit(unitIdx);
2000 GL_CALL(BindTexture(GR_GL_TEXTURE_2D, texture->textureID())); 2000 GL_CALL(BindTexture(GR_GL_TEXTURE_2D, texture->textureID()));
2001 fHWBoundTextures[unitIdx] = texture; 2001 fHWBoundTextures[unitIdx] = texture;
2002 } 2002 }
2003 2003
2004 ResetTimestamp timestamp; 2004 ResetTimestamp timestamp;
2005 const GrGLTexture::TexParams& oldTexParams = texture->getCachedTexParams(&ti mestamp); 2005 const GrGLTexture::TexParams& oldTexParams = texture->getCachedTexParams(&ti mestamp);
2006 bool setAll = timestamp < this->getResetTimestamp(); 2006 bool setAll = timestamp < this->getResetTimestamp();
2007 GrGLTexture::TexParams newTexParams; 2007 GrGLTexture::TexParams newTexParams;
2008 2008
2009 newTexParams.fFilter = params.isBilerp() ? GR_GL_LINEAR : GR_GL_NEAREST; 2009 newTexParams.fFilter = (params.filterMode() == GrTextureParams::kNone_Filter Mode) ? GR_GL_LINEAR : GR_GL_NEAREST;
2010 2010
2011 newTexParams.fWrapS = tile_to_gl_wrap(params.getTileModeX()); 2011 newTexParams.fWrapS = tile_to_gl_wrap(params.getTileModeX());
2012 newTexParams.fWrapT = tile_to_gl_wrap(params.getTileModeY()); 2012 newTexParams.fWrapT = tile_to_gl_wrap(params.getTileModeY());
2013 memcpy(newTexParams.fSwizzleRGBA, 2013 memcpy(newTexParams.fSwizzleRGBA,
2014 GrGLShaderBuilder::GetTexParamSwizzle(texture->config(), this->glCaps ()), 2014 GrGLShaderBuilder::GetTexParamSwizzle(texture->config(), this->glCaps ()),
2015 sizeof(newTexParams.fSwizzleRGBA)); 2015 sizeof(newTexParams.fSwizzleRGBA));
2016 if (setAll || newTexParams.fFilter != oldTexParams.fFilter) { 2016 if (setAll || newTexParams.fFilter != oldTexParams.fFilter) {
2017 this->setTextureUnit(unitIdx); 2017 this->setTextureUnit(unitIdx);
2018 GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, 2018 GL_CALL(TexParameteri(GR_GL_TEXTURE_2D,
2019 GR_GL_TEXTURE_MAG_FILTER, 2019 GR_GL_TEXTURE_MAG_FILTER,
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
2515 this->setVertexArrayID(gpu, 0); 2515 this->setVertexArrayID(gpu, 0);
2516 } 2516 }
2517 int attrCount = gpu->glCaps().maxVertexAttributes(); 2517 int attrCount = gpu->glCaps().maxVertexAttributes();
2518 if (fDefaultVertexArrayAttribState.count() != attrCount) { 2518 if (fDefaultVertexArrayAttribState.count() != attrCount) {
2519 fDefaultVertexArrayAttribState.resize(attrCount); 2519 fDefaultVertexArrayAttribState.resize(attrCount);
2520 } 2520 }
2521 attribState = &fDefaultVertexArrayAttribState; 2521 attribState = &fDefaultVertexArrayAttribState;
2522 } 2522 }
2523 return attribState; 2523 return attribState;
2524 } 2524 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrTextureDomainEffect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698