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

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

Issue 359803003: 32 bpp floating point textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback incorporated Created 6 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
« 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 "GrGLNameAllocator.h" 10 #include "GrGLNameAllocator.h"
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 } 632 }
633 dst += trimRowBytes; 633 dst += trimRowBytes;
634 } 634 }
635 // now point data to our copied version 635 // now point data to our copied version
636 data = tempStorage.get(); 636 data = tempStorage.get();
637 } 637 }
638 } 638 }
639 if (glFlipY) { 639 if (glFlipY) {
640 GL_CALL(PixelStorei(GR_GL_UNPACK_FLIP_Y, GR_GL_TRUE)); 640 GL_CALL(PixelStorei(GR_GL_UNPACK_FLIP_Y, GR_GL_TRUE));
641 } 641 }
642 GL_CALL(PixelStorei(GR_GL_UNPACK_ALIGNMENT, static_cast<GrGLint>(bpp))); 642 GL_CALL(PixelStorei(GR_GL_UNPACK_ALIGNMENT,
643 static_cast<GrGLint>(GrUnpackAlignment(dataConfig))));
643 } 644 }
644 bool succeeded = true; 645 bool succeeded = true;
645 if (isNewTexture && 646 if (isNewTexture &&
646 0 == left && 0 == top && 647 0 == left && 0 == top &&
647 desc.fWidth == width && desc.fHeight == height) { 648 desc.fWidth == width && desc.fHeight == height) {
648 CLEAR_ERROR_BEFORE_ALLOC(this->glInterface()); 649 CLEAR_ERROR_BEFORE_ALLOC(this->glInterface());
649 if (useTexStorage) { 650 if (useTexStorage) {
650 // We never resize or change formats of textures. 651 // We never resize or change formats of textures.
651 GL_ALLOC_CALL(this->glInterface(), 652 GL_ALLOC_CALL(this->glInterface(),
652 TexStorage2D(GR_GL_TEXTURE_2D, 653 TexStorage2D(GR_GL_TEXTURE_2D,
(...skipping 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after
2690 *internalFormat = GR_GL_COMPRESSED_RED_RGTC1; 2691 *internalFormat = GR_GL_COMPRESSED_RED_RGTC1;
2691 break; 2692 break;
2692 case GrGLCaps::k3DC_LATCAlias: 2693 case GrGLCaps::k3DC_LATCAlias:
2693 *internalFormat = GR_GL_COMPRESSED_3DC_X; 2694 *internalFormat = GR_GL_COMPRESSED_3DC_X;
2694 break; 2695 break;
2695 } 2696 }
2696 break; 2697 break;
2697 case kR11_EAC_GrPixelConfig: 2698 case kR11_EAC_GrPixelConfig:
2698 *internalFormat = GR_GL_COMPRESSED_R11; 2699 *internalFormat = GR_GL_COMPRESSED_R11;
2699 break; 2700 break;
2701 case kRGBA_float_GrPixelConfig:
2702 *internalFormat = GR_GL_RGBA32F;
2703 *externalFormat = GR_GL_RGBA;
2704 *externalType = GR_GL_FLOAT;
2705 break;
2700 default: 2706 default:
2701 return false; 2707 return false;
2702 } 2708 }
2703 return true; 2709 return true;
2704 } 2710 }
2705 2711
2706 void GrGpuGL::setTextureUnit(int unit) { 2712 void GrGpuGL::setTextureUnit(int unit) {
2707 SkASSERT(unit >= 0 && unit < fHWBoundTextures.count()); 2713 SkASSERT(unit >= 0 && unit < fHWBoundTextures.count());
2708 if (unit != fHWActiveTextureUnitIdx) { 2714 if (unit != fHWActiveTextureUnitIdx) {
2709 GL_CALL(ActiveTexture(GR_GL_TEXTURE0 + unit)); 2715 GL_CALL(ActiveTexture(GR_GL_TEXTURE0 + unit));
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
3018 this->setVertexArrayID(gpu, 0); 3024 this->setVertexArrayID(gpu, 0);
3019 } 3025 }
3020 int attrCount = gpu->glCaps().maxVertexAttributes(); 3026 int attrCount = gpu->glCaps().maxVertexAttributes();
3021 if (fDefaultVertexArrayAttribState.count() != attrCount) { 3027 if (fDefaultVertexArrayAttribState.count() != attrCount) {
3022 fDefaultVertexArrayAttribState.resize(attrCount); 3028 fDefaultVertexArrayAttribState.resize(attrCount);
3023 } 3029 }
3024 attribState = &fDefaultVertexArrayAttribState; 3030 attribState = &fDefaultVertexArrayAttribState;
3025 } 3031 }
3026 return attribState; 3032 return attribState;
3027 } 3033 }
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