aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ccpr/GrCCPathProcessor.cpp
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2018-06-14 10:14:50 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-14 17:21:47 +0000
commit9414c96781d7f95a066b95261f333f0c0b46b39f (patch)
tree2f1831cb94e22a1f151dd907536a96e3061381c9 /src/gpu/ccpr/GrCCPathProcessor.cpp
parent653f34da95f3717d048b1961760f09dc28138321 (diff)
ccpr: Generalize GrCCAtlas to work for cached atlases as well
Converts atlas offsets to SkIVector, adds a GrCCAtlasStack class, moves the Op that renders the atlases into GrCCPerFlushResources, etc. Bug: skia: Change-Id: I5110be8e74da709f3ce84bb6798ead572142d0fa Reviewed-on: https://skia-review.googlesource.com/134701 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/ccpr/GrCCPathProcessor.cpp')
-rw-r--r--src/gpu/ccpr/GrCCPathProcessor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gpu/ccpr/GrCCPathProcessor.cpp b/src/gpu/ccpr/GrCCPathProcessor.cpp
index 5edc45ff69..39d5ef2819 100644
--- a/src/gpu/ccpr/GrCCPathProcessor.cpp
+++ b/src/gpu/ccpr/GrCCPathProcessor.cpp
@@ -83,15 +83,15 @@ GrCCPathProcessor::GrCCPathProcessor(GrResourceProvider* resourceProvider,
GrSamplerState::WrapMode::kClamp, kFragment_GrShaderFlag) {
this->addInstanceAttrib("devbounds", kFloat4_GrVertexAttribType);
this->addInstanceAttrib("devbounds45", kFloat4_GrVertexAttribType);
- this->addInstanceAttrib("atlas_offset", kShort2_GrVertexAttribType);
+ this->addInstanceAttrib("dev_to_atlas_offset", kInt2_GrVertexAttribType);
this->addInstanceAttrib("color", kUByte4_norm_GrVertexAttribType);
SkASSERT(offsetof(Instance, fDevBounds) ==
this->getInstanceAttrib(InstanceAttribs::kDevBounds).offsetInRecord());
SkASSERT(offsetof(Instance, fDevBounds45) ==
this->getInstanceAttrib(InstanceAttribs::kDevBounds45).offsetInRecord());
- SkASSERT(offsetof(Instance, fAtlasOffset) ==
- this->getInstanceAttrib(InstanceAttribs::kAtlasOffset).offsetInRecord());
+ SkASSERT(offsetof(Instance, fDevToAtlasOffset) ==
+ this->getInstanceAttrib(InstanceAttribs::kDevToAtlasOffset).offsetInRecord());
SkASSERT(offsetof(Instance, fColor) ==
this->getInstanceAttrib(InstanceAttribs::kColor).offsetInRecord());
SkASSERT(sizeof(Instance) == this->getInstanceStride());
@@ -208,7 +208,7 @@ void GLSLPathProcessor::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
// Convert to atlas coordinates in order to do our texture lookup.
v->codeAppendf("float2 atlascoord = octocoord + float2(%s);",
- proc.getInstanceAttrib(InstanceAttribs::kAtlasOffset).name());
+ proc.getInstanceAttrib(InstanceAttribs::kDevToAtlasOffset).name());
if (kTopLeft_GrSurfaceOrigin == proc.atlasProxy()->origin()) {
v->codeAppendf("%s.xy = atlascoord * %s;", texcoord.vsOut(), atlasAdjust);
} else {