diff options
author | Chris Dalton <csmartdalton@google.com> | 2017-10-24 13:22:10 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-25 15:44:05 +0000 |
commit | a045eea29eb79254248d7e2666825a1ca7d23d4e (patch) | |
tree | 4a0a55d8476a100c1fa5b54ca5212a02723a148f /src/gpu/ccpr | |
parent | d204eb80abb0172b024664cf9f05d66d15574a24 (diff) |
CCPR: use 16-bit ints for the atlas offset attrib
Bug: skia:
Change-Id: I053e8416ced317b6ebc46cc8189840d60c7f91e8
Reviewed-on: https://skia-review.googlesource.com/62060
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/gpu/ccpr')
-rw-r--r-- | src/gpu/ccpr/GrCCPRPathProcessor.cpp | 4 | ||||
-rw-r--r-- | src/gpu/ccpr/GrCCPRPathProcessor.h | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/gpu/ccpr/GrCCPRPathProcessor.cpp b/src/gpu/ccpr/GrCCPRPathProcessor.cpp index 6608ce8114..ff3c60c134 100644 --- a/src/gpu/ccpr/GrCCPRPathProcessor.cpp +++ b/src/gpu/ccpr/GrCCPRPathProcessor.cpp @@ -56,9 +56,7 @@ GrCCPRPathProcessor::GrCCPRPathProcessor(GrResourceProvider* rp, sk_sp<GrTexture this->addInstanceAttrib("devbounds45", kFloat4_GrVertexAttribType); this->addInstanceAttrib("view_matrix", kFloat4_GrVertexAttribType); this->addInstanceAttrib("view_translate", kFloat2_GrVertexAttribType); - // FIXME: this could be a vector of two shorts if it were supported by Ganesh. - // Note: this should be doable now with kUShort2_GrVertexAttribType - this->addInstanceAttrib("atlas_offset", kInt2_GrVertexAttribType); + this->addInstanceAttrib("atlas_offset", kShort2_GrVertexAttribType); this->addInstanceAttrib("color", kUByte4_norm_GrVertexAttribType); SkASSERT(offsetof(Instance, fDevBounds) == diff --git a/src/gpu/ccpr/GrCCPRPathProcessor.h b/src/gpu/ccpr/GrCCPRPathProcessor.h index dbc1e5847e..82711756ee 100644 --- a/src/gpu/ccpr/GrCCPRPathProcessor.h +++ b/src/gpu/ccpr/GrCCPRPathProcessor.h @@ -46,13 +46,13 @@ public: // | 1 1 | std::array<float, 4> fViewMatrix; // {kScaleX, kSkewy, kSkewX, kScaleY} std::array<float, 2> fViewTranslate; - std::array<int32_t, 2> fAtlasOffset; + std::array<int16_t, 2> fAtlasOffset; uint32_t fColor; GR_STATIC_ASSERT(SK_SCALAR_IS_FLOAT); }; - GR_STATIC_ASSERT(4 * 17 == sizeof(Instance)); // FIXME: 4 * 16 by making fAtlasOffset int16_t's. + GR_STATIC_ASSERT(4 * 16 == sizeof(Instance)); GrCCPRPathProcessor(GrResourceProvider*, sk_sp<GrTextureProxy> atlas, SkPath::FillType, const GrShaderCaps&); |