diff options
author | Jim Van Verth <jvanverth@google.com> | 2017-09-07 14:48:04 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-08 14:17:53 +0000 |
commit | 7f754260f7fc2ae0326a072dd2f0429e584f8ca0 (patch) | |
tree | 7df7a94cdf828e3832723c6756c3faceab82d9ca /src/gpu/ops | |
parent | 7231c50f9c21cb13f428efe2a3bdbcf29543799a (diff) |
Add multitexture support to text and path shaders
This does not add additional textures to the atlases, just adds the
ability to access those textures in the shaders.
Bug: skia:3550
Change-Id: I636b329a6f748b6753f5f92a70066fb412623df2
Reviewed-on: https://skia-review.googlesource.com/43000
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/gpu/ops')
-rw-r--r-- | src/gpu/ops/GrSmallPathRenderer.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp index 1b0648615d..ec63e9ec7d 100644 --- a/src/gpu/ops/GrSmallPathRenderer.cpp +++ b/src/gpu/ops/GrSmallPathRenderer.cpp @@ -485,10 +485,12 @@ private: shapeData->fBounds.fRight /= scale; shapeData->fBounds.fBottom /= scale; - shapeData->fTextureCoords.set(atlasLocation.fX+SK_DistanceFieldPad, - atlasLocation.fY+SK_DistanceFieldPad, - atlasLocation.fX+SK_DistanceFieldPad+devPathBounds.width(), - atlasLocation.fY+SK_DistanceFieldPad+devPathBounds.height()); + shapeData->fTextureCoords.set((atlasLocation.fX+SK_DistanceFieldPad) << 1, + (atlasLocation.fY+SK_DistanceFieldPad) << 1, + (atlasLocation.fX+SK_DistanceFieldPad+ + devPathBounds.width()) << 1, + (atlasLocation.fY+SK_DistanceFieldPad+ + devPathBounds.height()) << 1); fShapeCache->add(shapeData); fShapeList->addToTail(shapeData); @@ -576,8 +578,9 @@ private: shapeData->fBounds = SkRect::Make(devPathBounds); shapeData->fBounds.offset(-translateX, -translateY); - shapeData->fTextureCoords.set(atlasLocation.fX, atlasLocation.fY, - atlasLocation.fX+width, atlasLocation.fY+height); + shapeData->fTextureCoords.set(atlasLocation.fX << 1, atlasLocation.fY << 1, + (atlasLocation.fX+width) << 1, + (atlasLocation.fY+height) << 1); fShapeCache->add(shapeData); fShapeList->addToTail(shapeData); |