diff options
author | Chris Dalton <csmartdalton@google.com> | 2018-06-14 10:14:50 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-14 17:21:47 +0000 |
commit | 9414c96781d7f95a066b95261f333f0c0b46b39f (patch) | |
tree | 2f1831cb94e22a1f151dd907536a96e3061381c9 /src/gpu/ccpr/GrCCPathProcessor.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/GrCCPathProcessor.h')
-rw-r--r-- | src/gpu/ccpr/GrCCPathProcessor.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gpu/ccpr/GrCCPathProcessor.h b/src/gpu/ccpr/GrCCPathProcessor.h index 9d97bad91a..9ea0a164a0 100644 --- a/src/gpu/ccpr/GrCCPathProcessor.h +++ b/src/gpu/ccpr/GrCCPathProcessor.h @@ -32,23 +32,23 @@ public: enum class InstanceAttribs { kDevBounds, kDevBounds45, - kAtlasOffset, + kDevToAtlasOffset, kColor }; static constexpr int kNumInstanceAttribs = 1 + (int)InstanceAttribs::kColor; struct Instance { - SkRect fDevBounds; // "right < left" indicates even-odd fill type. - SkRect fDevBounds45; // Bounding box in "| 1 -1 | * devCoords" space. - // | 1 1 | - std::array<int16_t, 2> fAtlasOffset; + SkRect fDevBounds; // "right < left" indicates even-odd fill type. + SkRect fDevBounds45; // Bounding box in "| 1 -1 | * devCoords" space. + // | 1 1 | + SkIVector fDevToAtlasOffset; // Translation from device space to location in atlas. uint32_t fColor; void set(SkPath::FillType, const SkRect& devBounds, const SkRect& devBounds45, - int16_t atlasOffsetX, int16_t atlasOffsetY, uint32_t color); + const SkIVector& devToAtlasOffset, uint32_t color); }; - GR_STATIC_ASSERT(4 * 10 == sizeof(Instance)); + GR_STATIC_ASSERT(4 * 11 == sizeof(Instance)); static sk_sp<const GrBuffer> FindVertexBuffer(GrOnFlushResourceProvider*); static sk_sp<const GrBuffer> FindIndexBuffer(GrOnFlushResourceProvider*); @@ -87,8 +87,8 @@ private: }; inline void GrCCPathProcessor::Instance::set(SkPath::FillType fillType, const SkRect& devBounds, - const SkRect& devBounds45, int16_t atlasOffsetX, - int16_t atlasOffsetY, uint32_t color) { + const SkRect& devBounds45, + const SkIVector& devToAtlasOffset, uint32_t color) { if (SkPath::kEvenOdd_FillType == fillType) { // "right < left" indicates even-odd fill type. fDevBounds.setLTRB(devBounds.fRight, devBounds.fTop, devBounds.fLeft, devBounds.fBottom); @@ -97,7 +97,7 @@ inline void GrCCPathProcessor::Instance::set(SkPath::FillType fillType, const Sk fDevBounds = devBounds; } fDevBounds45 = devBounds45; - fAtlasOffset = {{atlasOffsetX, atlasOffsetY}}; + fDevToAtlasOffset = devToAtlasOffset; fColor = color; } |