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

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

Issue 1186113007: Refactor separable varying location info to be stored in GrGLProgram subclass (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "GrGLPathProgram.h"
9 #include "GrGLPathProcessor.h"
10 #include "GrGLGpu.h"
11 #include "GrPathProcessor.h"
12
13 GrGLPathProgram::GrGLPathProgram(GrGLGpu* gpu,
14 const GrProgramDesc& desc,
15 const BuiltinUniformHandles& builtinUniforms,
16 GrGLuint programID,
17 const UniformInfoArray& uniforms,
18 const SeparableVaryingInfoArray& separableVaryi ngs,
19 GrGLInstalledGeoProc* primProc,
20 GrGLInstalledXferProc* xferProcessor,
21 GrGLInstalledFragProcs* fragmentProcessors)
22 : INHERITED(gpu, desc, builtinUniforms, programID, uniforms, primProc,
23 xferProcessor, fragmentProcessors)
24 , fPathProgramDataManager(gpu, fProgramID, separableVaryings) {
25 }
26 void GrGLPathProgram::didSetData() {
27 GrGLPathProcessor* pathProc =
28 static_cast<GrGLPathProcessor*>(fGeometryProcessor.get()->fGLProc.ge t());
29 pathProc->didSetData(fGpu->glPathRendering());
30 }
31
32 void GrGLPathProgram::setTransformData(const GrPrimitiveProcessor& primProc,
33 const GrPendingFragmentStage& proc,
34 int index,
35 GrGLInstalledFragProc* ip) {
36 GrGLPathProcessor* pathProc =
37 static_cast<GrGLPathProcessor*>(fGeometryProcessor.get()->fGLProc.ge t());
38 pathProc->setTransformData(primProc, fPathProgramDataManager, index,
39 proc.processor()->coordTransforms());
40 }
41
42 void GrGLPathProgram::onSetRenderTargetState(const GrPrimitiveProcessor& primPro c,
43 const GrPipeline& pipeline) {
44 SkASSERT(!primProc.willUseGeoShader() && primProc.numAttribs() == 0);
45 const GrRenderTarget* rt = pipeline.getRenderTarget();
46 SkISize size;
47 size.set(rt->width(), rt->height());
48 const GrPathProcessor& pathProc = primProc.cast<GrPathProcessor>();
49 fGpu->glPathRendering()->setProjectionMatrix(pathProc.viewMatrix(),
50 size, rt->origin());
51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698