diff options
author | 2018-06-14 10:14:50 -0600 | |
---|---|---|
committer | 2018-06-14 17:21:47 +0000 | |
commit | 9414c96781d7f95a066b95261f333f0c0b46b39f (patch) | |
tree | 2f1831cb94e22a1f151dd907536a96e3061381c9 /src/gpu/ccpr/GrCCPathParser.h | |
parent | 653f34da95f3717d048b1961760f09dc28138321 (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/GrCCPathParser.h')
-rw-r--r-- | src/gpu/ccpr/GrCCPathParser.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gpu/ccpr/GrCCPathParser.h b/src/gpu/ccpr/GrCCPathParser.h index b48a0b8adf..1c09b98024 100644 --- a/src/gpu/ccpr/GrCCPathParser.h +++ b/src/gpu/ccpr/GrCCPathParser.h @@ -9,7 +9,6 @@ #define GrCCPathParser_DEFINED #include "GrMesh.h" -#include "GrNonAtomicRef.h" #include "SkPath.h" #include "SkPathPriv.h" #include "SkRect.h" @@ -27,7 +26,7 @@ class SkPath; * This class parses SkPaths into CCPR primitives in GPU buffers, then issues calls to draw their * coverage counts. */ -class GrCCPathParser : public GrNonAtomicRef<GrCCPathParser> { +class GrCCPathParser { public: // Indicates whether a path should enforce a scissor clip when rendering its mask. (Specified // as an int because these values get used directly as indices into arrays.) @@ -68,8 +67,8 @@ public: // Commits the currently-parsed path from staging to the current batch, and specifies whether // the mask should be rendered with a scissor in effect. Accepts an optional post-device-space // translate for placement in an atlas. - void saveParsedPath(ScissorMode, const SkIRect& clippedDevIBounds, int16_t atlasOffsetX, - int16_t atlasOffsetY); + void saveParsedPath(ScissorMode, const SkIRect& clippedDevIBounds, + const SkIVector& devToAtlasOffset); void discardParsedPath(); // Compiles the outstanding saved paths into a batch, and returns an ID that can be used to draw @@ -89,12 +88,11 @@ private: // Every kBeginPath verb has a corresponding PathInfo entry. class PathInfo { public: - PathInfo(ScissorMode scissorMode, int16_t offsetX, int16_t offsetY) - : fScissorMode(scissorMode), fAtlasOffsetX(offsetX), fAtlasOffsetY(offsetY) {} + PathInfo(ScissorMode scissorMode, const SkIVector& devToAtlasOffset) + : fScissorMode(scissorMode), fDevToAtlasOffset(devToAtlasOffset) {} ScissorMode scissorMode() const { return fScissorMode; } - int16_t atlasOffsetX() const { return fAtlasOffsetX; } - int16_t atlasOffsetY() const { return fAtlasOffsetY; } + const SkIVector& devToAtlasOffset() const { return fDevToAtlasOffset; } // An empty tessellation fan is also valid; we use negative count to denote not tessellated. bool hasFanTessellation() const { return fFanTessellationCount >= 0; } @@ -115,7 +113,7 @@ private: private: ScissorMode fScissorMode; - int16_t fAtlasOffsetX, fAtlasOffsetY; + SkIVector fDevToAtlasOffset; // Translation from device space to location in atlas. int fFanTessellationCount = -1; std::unique_ptr<const GrTessellator::WindingVertex[]> fFanTessellation; }; |