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 "GrGpuGL.h" | 9 #include "GrGpuGL.h" |
10 #include "GrGLStencilBuffer.h" | 10 #include "GrGLStencilBuffer.h" |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 GrGLenum externalType = 0x0;// suprress warning | 561 GrGLenum externalType = 0x0;// suprress warning |
562 | 562 |
563 // glTexStorage requires sized internal formats on both desktop and ES. ES2
requires an unsized | 563 // glTexStorage requires sized internal formats on both desktop and ES. ES2
requires an unsized |
564 // format for glTexImage, unlike ES3 and desktop. However, we allow the driv
er to decide the | 564 // format for glTexImage, unlike ES3 and desktop. However, we allow the driv
er to decide the |
565 // size of the internal format whenever possible and so only use a sized int
ernal format when | 565 // size of the internal format whenever possible and so only use a sized int
ernal format when |
566 // using texture storage. | 566 // using texture storage. |
567 bool useSizedFormat = useTexStorage; | 567 bool useSizedFormat = useTexStorage; |
568 // At least some versions of the ES3 drivers for NVIDIA and IMG won't accept
GL_RED in | 568 // At least some versions of the ES3 drivers for NVIDIA and IMG won't accept
GL_RED in |
569 // glTexImage2D for the internal format but will accept GL_R8. | 569 // glTexImage2D for the internal format but will accept GL_R8. |
570 if (kNVIDIA_GrGLVendor == this->glContext().vendor() || | 570 if (kNVIDIA_GrGLVendor == this->glContext().vendor() || |
571 kImagination_GrGLVendor == this->glContext().vendor()) { | 571 kImagination_GrGLVendor == this->glContext().vendor() || |
| 572 this->glContext().isMesa()) { |
572 if (kGLES_GrGLStandard == this->glStandard() && this->glVersion() >= GR_
GL_VER(3, 0) && | 573 if (kGLES_GrGLStandard == this->glStandard() && this->glVersion() >= GR_
GL_VER(3, 0) && |
573 kAlpha_8_GrPixelConfig == dataConfig) { | 574 kAlpha_8_GrPixelConfig == dataConfig) { |
574 useSizedFormat = true; | 575 useSizedFormat = true; |
575 } | 576 } |
576 } | 577 } |
577 if (!this->configToGLFormats(dataConfig, useSizedFormat, &internalFormat, | 578 if (!this->configToGLFormats(dataConfig, useSizedFormat, &internalFormat, |
578 &externalFormat, &externalType)) { | 579 &externalFormat, &externalType)) { |
579 return false; | 580 return false; |
580 } | 581 } |
581 | 582 |
(...skipping 1974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2556 this->setVertexArrayID(gpu, 0); | 2557 this->setVertexArrayID(gpu, 0); |
2557 } | 2558 } |
2558 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2559 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2559 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2560 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2560 fDefaultVertexArrayAttribState.resize(attrCount); | 2561 fDefaultVertexArrayAttribState.resize(attrCount); |
2561 } | 2562 } |
2562 attribState = &fDefaultVertexArrayAttribState; | 2563 attribState = &fDefaultVertexArrayAttribState; |
2563 } | 2564 } |
2564 return attribState; | 2565 return attribState; |
2565 } | 2566 } |
OLD | NEW |