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

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

Issue 1152563003: Further work on sRGB support. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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') | 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 "GrGLGpu.h" 9 #include "GrGLGpu.h"
10 #include "GrGLStencilAttachment.h" 10 #include "GrGLStencilAttachment.h"
(...skipping 2366 matching lines...) Expand 10 before | Expand all | Expand 10 after
2377 } else { 2377 } else {
2378 *internalFormat = GR_GL_RGBA; 2378 *internalFormat = GR_GL_RGBA;
2379 } 2379 }
2380 } 2380 }
2381 *externalFormat = GR_GL_BGRA; 2381 *externalFormat = GR_GL_BGRA;
2382 *externalType = GR_GL_UNSIGNED_BYTE; 2382 *externalType = GR_GL_UNSIGNED_BYTE;
2383 break; 2383 break;
2384 case kSRGBA_8888_GrPixelConfig: 2384 case kSRGBA_8888_GrPixelConfig:
2385 *internalFormat = GR_GL_SRGB_ALPHA; 2385 *internalFormat = GR_GL_SRGB_ALPHA;
2386 *externalFormat = GR_GL_SRGB_ALPHA; 2386 *externalFormat = GR_GL_SRGB_ALPHA;
2387 if (getSizedInternalFormat) { 2387 if (getSizedInternalFormat || kGL_GrGLStandard == this->glStandard() ) {
2388 // desktop or ES 3.0
2389 SkASSERT(this->glVersion() >= GR_GL_VER(3, 0));
2388 *internalFormat = GR_GL_SRGB8_ALPHA8; 2390 *internalFormat = GR_GL_SRGB8_ALPHA8;
2391 *externalFormat = GR_GL_RGBA;
2389 } else { 2392 } else {
2393 // ES 2.0 with EXT_sRGB
2394 SkASSERT(kGL_GrGLStandard != this->glStandard() &&
2395 this->glVersion() < GR_GL_VER(3, 0));
2390 *internalFormat = GR_GL_SRGB_ALPHA; 2396 *internalFormat = GR_GL_SRGB_ALPHA;
2397 *externalFormat = GR_GL_SRGB_ALPHA;
2391 } 2398 }
2392 *externalType = GR_GL_UNSIGNED_BYTE; 2399 *externalType = GR_GL_UNSIGNED_BYTE;
2393 break; 2400 break;
2394 case kRGB_565_GrPixelConfig: 2401 case kRGB_565_GrPixelConfig:
2395 *internalFormat = GR_GL_RGB; 2402 *internalFormat = GR_GL_RGB;
2396 *externalFormat = GR_GL_RGB; 2403 *externalFormat = GR_GL_RGB;
2397 if (getSizedInternalFormat) { 2404 if (getSizedInternalFormat) {
2398 if (!this->glCaps().ES2CompatibilitySupport()) { 2405 if (!this->glCaps().ES2CompatibilitySupport()) {
2399 *internalFormat = GR_GL_RGB5; 2406 *internalFormat = GR_GL_RGB5;
2400 } else { 2407 } else {
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
2866 this->setVertexArrayID(gpu, 0); 2873 this->setVertexArrayID(gpu, 0);
2867 } 2874 }
2868 int attrCount = gpu->glCaps().maxVertexAttributes(); 2875 int attrCount = gpu->glCaps().maxVertexAttributes();
2869 if (fDefaultVertexArrayAttribState.count() != attrCount) { 2876 if (fDefaultVertexArrayAttribState.count() != attrCount) {
2870 fDefaultVertexArrayAttribState.resize(attrCount); 2877 fDefaultVertexArrayAttribState.resize(attrCount);
2871 } 2878 }
2872 attribState = &fDefaultVertexArrayAttribState; 2879 attribState = &fDefaultVertexArrayAttribState;
2873 } 2880 }
2874 return attribState; 2881 return attribState;
2875 } 2882 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLDefines.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698