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

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

Issue 26695005: separate state for msaa renderability (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: bool to int Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGpuGL.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 2012 Google Inc. 2 * Copyright 2012 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 "GrGLCaps.h" 9 #include "GrGLCaps.h"
10 #include "GrGLContext.h" 10 #include "GrGLContext.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 // ES 2.0 361 // ES 2.0
362 // color renderable: RGBA4, RGB5_A1, RGB565 362 // color renderable: RGBA4, RGB5_A1, RGB565
363 // GL_EXT_texture_rg adds support for R8 as a color render target 363 // GL_EXT_texture_rg adds support for R8 as a color render target
364 // GL_OES_rgb8_rgba8 and/or GL_ARM_rgba8 adds support for RGBA8 364 // GL_OES_rgb8_rgba8 and/or GL_ARM_rgba8 adds support for RGBA8
365 // GL_EXT_texture_format_BGRA8888 and/or GL_APPLE_texture_format_BGRA8888 a dded BGRA support 365 // GL_EXT_texture_format_BGRA8888 and/or GL_APPLE_texture_format_BGRA8888 a dded BGRA support
366 366
367 // ES 3.0 367 // ES 3.0
368 // Same as ES 2.0 except R8 and RGBA8 are supported without extensions (the functions called 368 // Same as ES 2.0 except R8 and RGBA8 are supported without extensions (the functions called
369 // below already account for this). 369 // below already account for this).
370 370
371 enum {
372 kNo_MSAA = 0,
373 kYes_MSAA = 1,
374 };
375
371 if (kDesktop_GrGLBinding == ctxInfo.binding()) { 376 if (kDesktop_GrGLBinding == ctxInfo.binding()) {
372 // Post 3.0 we will get R8 377 // Post 3.0 we will get R8
373 // Prior to 3.0 we will get ALPHA8 (with GL_ARB_framebuffer_object) 378 // Prior to 3.0 we will get ALPHA8 (with GL_ARB_framebuffer_object)
374 if (ctxInfo.version() >= GR_GL_VER(3,0) || 379 if (ctxInfo.version() >= GR_GL_VER(3,0) ||
375 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { 380 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) {
376 fConfigRenderSupport[kAlpha_8_GrPixelConfig] = true; 381 fConfigRenderSupport[kAlpha_8_GrPixelConfig][kNo_MSAA] = true;
382 fConfigRenderSupport[kAlpha_8_GrPixelConfig][kYes_MSAA] = true;
377 } 383 }
378 } else { 384 } else {
379 // On ES we can only hope for R8 385 // On ES we can only hope for R8
380 fConfigRenderSupport[kAlpha_8_GrPixelConfig] = fTextureRedSupport; 386 fConfigRenderSupport[kAlpha_8_GrPixelConfig][kNo_MSAA] = fTextureRedSupp ort;
387 fConfigRenderSupport[kAlpha_8_GrPixelConfig][kYes_MSAA] = fTextureRedSup port;
381 } 388 }
382 389
383 if (kDesktop_GrGLBinding != ctxInfo.binding()) { 390 if (kDesktop_GrGLBinding != ctxInfo.binding()) {
384 // only available in ES 391 // only available in ES
385 fConfigRenderSupport[kRGB_565_GrPixelConfig] = true; 392 fConfigRenderSupport[kRGB_565_GrPixelConfig][kNo_MSAA] = true;
393 fConfigRenderSupport[kRGB_565_GrPixelConfig][kYes_MSAA] = true;
386 } 394 }
387 395
388 // we no longer support 444 as a render target 396 // we no longer support 444 as a render target
389 fConfigRenderSupport[kRGBA_4444_GrPixelConfig] = false; 397 fConfigRenderSupport[kRGBA_4444_GrPixelConfig][kNo_MSAA] = false;
398 fConfigRenderSupport[kRGBA_4444_GrPixelConfig][kYes_MSAA] = false;
390 399
391 if (this->fRGBA8RenderbufferSupport) { 400 if (this->fRGBA8RenderbufferSupport) {
392 fConfigRenderSupport[kRGBA_8888_GrPixelConfig] = true; 401 fConfigRenderSupport[kRGBA_8888_GrPixelConfig][kNo_MSAA] = true;
402 fConfigRenderSupport[kRGBA_4444_GrPixelConfig][kYes_MSAA] = false;
393 } 403 }
394 404
395 if (this->fBGRAFormatSupport) { 405 if (this->fBGRAFormatSupport) {
396 fConfigRenderSupport[kBGRA_8888_GrPixelConfig] = true; 406 fConfigRenderSupport[kBGRA_8888_GrPixelConfig][kNo_MSAA] = true;
407 // The GL_EXT_texture_format_BGRA8888 extension does not add BGRA to the list of
408 // configs that are color-renderable and can be passed to glRenderBuffer StorageMultisample.
409 fConfigRenderSupport[kBGRA_8888_GrPixelConfig][kYes_MSAA] =
410 !fBGRAIsInternalFormat || !this->usesMSAARenderBuffers();
411 }
412
413 // If we don't support MSAA then undo any places above where we set a config as renderable with
414 // msaa.
415 if (kNone_MSFBOType == fMSFBOType) {
416 for (int i = 0; i < kGrPixelConfigCnt; ++i) {
417 fConfigRenderSupport[i][kYes_MSAA] = false;
418 }
397 } 419 }
398 } 420 }
399 421
400 bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf, 422 bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf,
401 GrGLenum format, 423 GrGLenum format,
402 GrGLenum type) const { 424 GrGLenum type) const {
403 if (GR_GL_RGBA == format && GR_GL_UNSIGNED_BYTE == type) { 425 if (GR_GL_RGBA == format && GR_GL_UNSIGNED_BYTE == type) {
404 // ES 2 guarantees this format is supported 426 // ES 2 guarantees this format is supported
405 return true; 427 return true;
406 } 428 }
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 GrPrintf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); 646 GrPrintf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO"));
625 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); 647 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO"));
626 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); 648 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO"));
627 GrPrintf("Fragment coord conventions support: %s\n", 649 GrPrintf("Fragment coord conventions support: %s\n",
628 (fFragCoordsConventionSupport ? "YES": "NO")); 650 (fFragCoordsConventionSupport ? "YES": "NO"));
629 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? " YES": "NO")); 651 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? " YES": "NO"));
630 GrPrintf("Use non-VBO for dynamic data: %s\n", 652 GrPrintf("Use non-VBO for dynamic data: %s\n",
631 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); 653 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO"));
632 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : " NO")); 654 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : " NO"));
633 } 655 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGpuGL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698