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

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

Issue 1192663002: Implement support for CHROMIUM_path_rendering pseudo extension (Closed) Base URL: https://skia.googlesource.com/skia.git@chromium-pathrendering-prepare-03
Patch Set: rebase Created 5 years, 5 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 | « include/gpu/gl/GrGLInterface.h ('k') | src/gpu/gl/GrGLInterface.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 10
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 457
458 this->initConfigTexturableTable(ctxInfo, gli); 458 this->initConfigTexturableTable(ctxInfo, gli);
459 this->initConfigRenderableTable(ctxInfo); 459 this->initConfigRenderableTable(ctxInfo);
460 this->initShaderPrecisionTable(ctxInfo, gli, glslCaps); 460 this->initShaderPrecisionTable(ctxInfo, gli, glslCaps);
461 461
462 this->applyOptionsOverrides(contextOptions); 462 this->applyOptionsOverrides(contextOptions);
463 glslCaps->applyOptionsOverrides(contextOptions); 463 glslCaps->applyOptionsOverrides(contextOptions);
464 } 464 }
465 465
466 bool GrGLCaps::hasPathRenderingSupport(const GrGLContextInfo& ctxInfo, const GrG LInterface* gli) { 466 bool GrGLCaps::hasPathRenderingSupport(const GrGLContextInfo& ctxInfo, const GrG LInterface* gli) {
467 if (!ctxInfo.hasExtension("GL_NV_path_rendering")) { 467 bool hasChromiumPathRendering = ctxInfo.hasExtension("GL_CHROMIUM_path_rende ring");
468
469 if (!(ctxInfo.hasExtension("GL_NV_path_rendering") || hasChromiumPathRenderi ng)) {
468 return false; 470 return false;
469 } 471 }
472
470 if (kGL_GrGLStandard == ctxInfo.standard()) { 473 if (kGL_GrGLStandard == ctxInfo.standard()) {
471 if (ctxInfo.version() < GR_GL_VER(4, 3) && 474 if (ctxInfo.version() < GR_GL_VER(4, 3) &&
472 !ctxInfo.hasExtension("GL_ARB_program_interface_query")) { 475 !ctxInfo.hasExtension("GL_ARB_program_interface_query")) {
473 return false; 476 return false;
474 } 477 }
475 } else { 478 } else {
476 if (ctxInfo.version() < GR_GL_VER(3, 1)) { 479 if (!hasChromiumPathRendering &&
480 ctxInfo.version() < GR_GL_VER(3, 1)) {
477 return false; 481 return false;
478 } 482 }
479 } 483 }
480 // We only support v1.3+ of GL_NV_path_rendering which allows us to 484 // We only support v1.3+ of GL_NV_path_rendering which allows us to
481 // set individual fragment inputs with ProgramPathFragmentInputGen. The API 485 // set individual fragment inputs with ProgramPathFragmentInputGen. The API
482 // additions are detected by checking the existence of the function. 486 // additions are detected by checking the existence of the function.
483 // We also use *Then* functions that not all drivers might have. Check 487 // We also use *Then* functions that not all drivers might have. Check
484 // them for consistency. 488 // them for consistency.
485 if (NULL == gli->fFunctions.fStencilThenCoverFillPath || 489 if (NULL == gli->fFunctions.fStencilThenCoverFillPath ||
486 NULL == gli->fFunctions.fStencilThenCoverStrokePath || 490 NULL == gli->fFunctions.fStencilThenCoverStrokePath ||
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 for (int p = 0; p < kGrSLPrecisionCount; ++p) { 1201 for (int p = 0; p < kGrSLPrecisionCount; ++p) {
1198 glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] = 1202 glslCaps->fFloatPrecisions[kGeometry_GrShaderType][p] =
1199 glslCaps->fFloatPrecisions[kVerte x_GrShaderType][p]; 1203 glslCaps->fFloatPrecisions[kVerte x_GrShaderType][p];
1200 } 1204 }
1201 } 1205 }
1202 } 1206 }
1203 1207
1204 1208
1205 1209
1206 1210
OLDNEW
« no previous file with comments | « include/gpu/gl/GrGLInterface.h ('k') | src/gpu/gl/GrGLInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698