OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |