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

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

Issue 791823003: Add sRGB texture support. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add in changes for copy_to_new_texture_pixelref 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
« include/core/SkPixelRef.h ('K') | « src/gpu/gl/GrGLDefines.h ('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 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after
2299 } else { 2299 } else {
2300 if (getSizedInternalFormat) { 2300 if (getSizedInternalFormat) {
2301 *internalFormat = GR_GL_RGBA8; 2301 *internalFormat = GR_GL_RGBA8;
2302 } else { 2302 } else {
2303 *internalFormat = GR_GL_RGBA; 2303 *internalFormat = GR_GL_RGBA;
2304 } 2304 }
2305 } 2305 }
2306 *externalFormat = GR_GL_BGRA; 2306 *externalFormat = GR_GL_BGRA;
2307 *externalType = GR_GL_UNSIGNED_BYTE; 2307 *externalType = GR_GL_UNSIGNED_BYTE;
2308 break; 2308 break;
2309 case kSRGBA_8888_GrPixelConfig:
2310 *internalFormat = GR_GL_SRGB_ALPHA;
2311 *externalFormat = GR_GL_SRGB_ALPHA;
2312 if (getSizedInternalFormat) {
2313 *internalFormat = GR_GL_SRGB8_ALPHA8;
2314 } else {
2315 *internalFormat = GR_GL_SRGB_ALPHA;
2316 }
2317 *externalType = GR_GL_UNSIGNED_BYTE;
2318 break;
2309 case kRGB_565_GrPixelConfig: 2319 case kRGB_565_GrPixelConfig:
2310 *internalFormat = GR_GL_RGB; 2320 *internalFormat = GR_GL_RGB;
2311 *externalFormat = GR_GL_RGB; 2321 *externalFormat = GR_GL_RGB;
2312 if (getSizedInternalFormat) { 2322 if (getSizedInternalFormat) {
2313 if (!this->glCaps().ES2CompatibilitySupport()) { 2323 if (!this->glCaps().ES2CompatibilitySupport()) {
2314 *internalFormat = GR_GL_RGB5; 2324 *internalFormat = GR_GL_RGB5;
2315 } else { 2325 } else {
2316 *internalFormat = GR_GL_RGB565; 2326 *internalFormat = GR_GL_RGB565;
2317 } 2327 }
2318 } else { 2328 } else {
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
2736 this->setVertexArrayID(gpu, 0); 2746 this->setVertexArrayID(gpu, 0);
2737 } 2747 }
2738 int attrCount = gpu->glCaps().maxVertexAttributes(); 2748 int attrCount = gpu->glCaps().maxVertexAttributes();
2739 if (fDefaultVertexArrayAttribState.count() != attrCount) { 2749 if (fDefaultVertexArrayAttribState.count() != attrCount) {
2740 fDefaultVertexArrayAttribState.resize(attrCount); 2750 fDefaultVertexArrayAttribState.resize(attrCount);
2741 } 2751 }
2742 attribState = &fDefaultVertexArrayAttribState; 2752 attribState = &fDefaultVertexArrayAttribState;
2743 } 2753 }
2744 return attribState; 2754 return attribState;
2745 } 2755 }
OLDNEW
« include/core/SkPixelRef.h ('K') | « src/gpu/gl/GrGLDefines.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698