aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/gpu
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-12-13 10:59:33 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-20 14:00:44 +0000
commitb5086961f335d6757a88ce7507c445485aaba2e6 (patch)
treea635252858428f4f0f04144d532cc4ab96388d95 /tools/gpu
parente1367b4a064737cbcf78f2297fa89e0a032b2060 (diff)
Add matrix stack to SkAtlasTextTarget.
Makes SkAtlasTextRenderer::SDFVertex now has a 3 component position vector. Change-Id: I7ec1a8068fb84388a82e1748d6e9d02820d55abd Reviewed-on: https://skia-review.googlesource.com/84202 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'tools/gpu')
-rw-r--r--tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp b/tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp
index ef416b2e39..677ce5a924 100644
--- a/tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp
+++ b/tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp
@@ -125,7 +125,7 @@ GLTestAtlasTextRenderer::GLTestAtlasTextRenderer(std::unique_ptr<GLTestContext>
uniform vec4 uDstScaleAndTranslate;
uniform vec2 uAtlasInvSize;
- layout (location = 0) in vec2 inPosition;
+ layout (location = 0) in vec3 inPosition;
layout (location = 1) in vec4 inColor;
layout (location = 2) in uvec2 inTextureCoords;
@@ -143,7 +143,7 @@ GLTestAtlasTextRenderer::GLTestAtlasTextRenderer(std::unique_ptr<GLTestContext>
vColor = inColor;
gl_Position = vec4(inPosition.x * uDstScaleAndTranslate.x + uDstScaleAndTranslate.y,
inPosition.y * uDstScaleAndTranslate.z + uDstScaleAndTranslate.w,
- 0.0, 1.0);
+ 0.0, inPosition.z);
}
)";
strings[1] = kVS;
@@ -360,8 +360,8 @@ void GLTestAtlasTextRenderer::drawSDFGlyphs(void* targetHandle, void* textureHan
callgl(BindVertexArray, 0);
callgl(BindBuffer, GR_GL_ARRAY_BUFFER, 0);
callgl(BindBuffer, GR_GL_ELEMENT_ARRAY_BUFFER, 0);
- callgl(VertexAttribPointer, 0, 2, GR_GL_FLOAT, GR_GL_FALSE, sizeof(SDFVertex), vertices);
- size_t colorOffset = 2 * sizeof(float);
+ callgl(VertexAttribPointer, 0, 3, GR_GL_FLOAT, GR_GL_FALSE, sizeof(SDFVertex), vertices);
+ size_t colorOffset = 3 * sizeof(float);
callgl(VertexAttribPointer, 1, 4, GR_GL_UNSIGNED_BYTE, GR_GL_TRUE, sizeof(SDFVertex),
reinterpret_cast<const char*>(vertices) + colorOffset);
size_t texOffset = colorOffset + sizeof(uint32_t);