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

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

Issue 762923003: Add support for half float alpha textures. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix config setup Created 6 years 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
« no previous file with comments | « src/gpu/gl/GrGLDefines.h ('k') | tests/FloatingPointTextureTest.cpp » ('j') | 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 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 case kASTC_12x12_GrPixelConfig: 2238 case kASTC_12x12_GrPixelConfig:
2239 *internalFormat = GR_GL_COMPRESSED_RGBA_ASTC_12x12; 2239 *internalFormat = GR_GL_COMPRESSED_RGBA_ASTC_12x12;
2240 break; 2240 break;
2241 2241
2242 case kRGBA_float_GrPixelConfig: 2242 case kRGBA_float_GrPixelConfig:
2243 *internalFormat = GR_GL_RGBA32F; 2243 *internalFormat = GR_GL_RGBA32F;
2244 *externalFormat = GR_GL_RGBA; 2244 *externalFormat = GR_GL_RGBA;
2245 *externalType = GR_GL_FLOAT; 2245 *externalType = GR_GL_FLOAT;
2246 break; 2246 break;
2247 2247
2248 case kAlpha_half_GrPixelConfig:
2249 if (this->glCaps().textureRedSupport()) {
2250 *internalFormat = GR_GL_R16F;
2251 *externalFormat = GR_GL_RED;
2252 *externalType = (kGLES_GrGLStandard == this->glStandard()) ? GR_ GL_HALF_FLOAT
2253 : GR_ GL_HALF_FLOAT_OES;
2254 } else {
2255 *internalFormat = GR_GL_ALPHA16F;
2256 *externalFormat = GR_GL_ALPHA;
2257 *externalType = (kGLES_GrGLStandard == this->glStandard()) ? GR_ GL_HALF_FLOAT
2258 : GR_ GL_HALF_FLOAT_OES;
2259 }
2260 break;
2261
2248 default: 2262 default:
2249 return false; 2263 return false;
2250 } 2264 }
2251 return true; 2265 return true;
2252 } 2266 }
2253 2267
2254 void GrGpuGL::setTextureUnit(int unit) { 2268 void GrGpuGL::setTextureUnit(int unit) {
2255 SkASSERT(unit >= 0 && unit < fHWBoundTextureUniqueIDs.count()); 2269 SkASSERT(unit >= 0 && unit < fHWBoundTextureUniqueIDs.count());
2256 if (unit != fHWActiveTextureUnitIdx) { 2270 if (unit != fHWActiveTextureUnitIdx) {
2257 GL_CALL(ActiveTexture(GR_GL_TEXTURE0 + unit)); 2271 GL_CALL(ActiveTexture(GR_GL_TEXTURE0 + unit));
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
2573 this->setVertexArrayID(gpu, 0); 2587 this->setVertexArrayID(gpu, 0);
2574 } 2588 }
2575 int attrCount = gpu->glCaps().maxVertexAttributes(); 2589 int attrCount = gpu->glCaps().maxVertexAttributes();
2576 if (fDefaultVertexArrayAttribState.count() != attrCount) { 2590 if (fDefaultVertexArrayAttribState.count() != attrCount) {
2577 fDefaultVertexArrayAttribState.resize(attrCount); 2591 fDefaultVertexArrayAttribState.resize(attrCount);
2578 } 2592 }
2579 attribState = &fDefaultVertexArrayAttribState; 2593 attribState = &fDefaultVertexArrayAttribState;
2580 } 2594 }
2581 return attribState; 2595 return attribState;
2582 } 2596 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLDefines.h ('k') | tests/FloatingPointTextureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698