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

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

Issue 452823002: Separate GL path rendering state from GrGpuGL to GrGLPathRendering (Closed) Base URL: https://skia.googlesource.com/skia.git@00xx-cherrypick-pathrendering-class
Patch Set: Created 6 years, 4 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/GrGLProgram.cpp ('k') | src/gpu/gl/GrGLUtil.h » ('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 2013 Google Inc. 2 * Copyright 2013 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 #include "GrGLProgramEffects.h" 8 #include "GrGLProgramEffects.h"
9 #include "GrDrawEffect.h" 9 #include "GrDrawEffect.h"
10 #include "gl/GrGLEffect.h" 10 #include "gl/GrGLEffect.h"
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 void GrGLPathTexGenProgramEffects::setPathTexGenState(GrGpuGL* gpu, 471 void GrGLPathTexGenProgramEffects::setPathTexGenState(GrGpuGL* gpu,
472 const GrDrawEffect& drawEffect, 472 const GrDrawEffect& drawEffect,
473 int effectIdx) { 473 int effectIdx) {
474 uint32_t totalKey = fTransforms[effectIdx].fTransformKey; 474 uint32_t totalKey = fTransforms[effectIdx].fTransformKey;
475 int texCoordIndex = fTransforms[effectIdx].fTexCoordIndex; 475 int texCoordIndex = fTransforms[effectIdx].fTexCoordIndex;
476 int numTransforms = drawEffect.effect()->numTransforms(); 476 int numTransforms = drawEffect.effect()->numTransforms();
477 for (int t = 0; t < numTransforms; ++t) { 477 for (int t = 0; t < numTransforms; ++t) {
478 switch (get_matrix_type(totalKey, t)) { 478 switch (get_matrix_type(totalKey, t)) {
479 case kNoPersp_MatrixType: { 479 case kNoPersp_MatrixType: {
480 const SkMatrix& transform = get_transform_matrix(drawEffect, t); 480 const SkMatrix& transform = get_transform_matrix(drawEffect, t);
481 gpu->enablePathTexGen(texCoordIndex++, 481 gpu->glPathRendering()->enablePathTexGen(
482 GrGpuGL::kST_PathTexGenComponents, 482 texCoordIndex++,
483 transform); 483 GrGLPathRendering::kST_PathTexGenComponents,
484 transform);
484 break; 485 break;
485 } 486 }
486 case kGeneral_MatrixType: { 487 case kGeneral_MatrixType: {
487 const SkMatrix& transform = get_transform_matrix(drawEffect, t); 488 const SkMatrix& transform = get_transform_matrix(drawEffect, t);
488 gpu->enablePathTexGen(texCoordIndex++, 489 gpu->glPathRendering()->enablePathTexGen(
489 GrGpuGL::kSTR_PathTexGenComponents, 490 texCoordIndex++,
490 transform); 491 GrGLPathRendering::kSTR_PathTexGenComponents,
492 transform);
491 break; 493 break;
492 } 494 }
493 default: 495 default:
494 SkFAIL("Unexpected matrixs type."); 496 SkFAIL("Unexpected matrixs type.");
495 } 497 }
496 } 498 }
497 } 499 }
498 500
499 GrGLPathTexGenProgramEffectsBuilder::GrGLPathTexGenProgramEffectsBuilder( 501 GrGLPathTexGenProgramEffectsBuilder::GrGLPathTexGenProgramEffectsBuilder(
500 GrGLFragmentOnlyShaderBuilder* builder, 502 GrGLFragmentOnlyShaderBuilder* builder,
501 int reserveCount) 503 int reserveCount)
502 : fBuilder(builder) 504 : fBuilder(builder)
503 , fProgramEffects(SkNEW_ARGS(GrGLPathTexGenProgramEffects, (reserveCount))) { 505 , fProgramEffects(SkNEW_ARGS(GrGLPathTexGenProgramEffects, (reserveCount))) {
504 } 506 }
505 507
506 void GrGLPathTexGenProgramEffectsBuilder::emitEffect(const GrEffectStage& stage, 508 void GrGLPathTexGenProgramEffectsBuilder::emitEffect(const GrEffectStage& stage,
507 const GrEffectKey& key, 509 const GrEffectKey& key,
508 const char* outColor, 510 const char* outColor,
509 const char* inColor, 511 const char* inColor,
510 int stageIndex) { 512 int stageIndex) {
511 SkASSERT(NULL != fProgramEffects.get()); 513 SkASSERT(NULL != fProgramEffects.get());
512 fProgramEffects->emitEffect(fBuilder, stage, key, outColor, inColor, stageIn dex); 514 fProgramEffects->emitEffect(fBuilder, stage, key, outColor, inColor, stageIn dex);
513 } 515 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgram.cpp ('k') | src/gpu/gl/GrGLUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698