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>
diff --git a/src/gpu/ccpr/GrCCClipPath.cpp b/src/gpu/ccpr/GrCCClipPath.cpp
index c988657..77674e4 100644
--- a/src/gpu/ccpr/GrCCClipPath.cpp
+++ b/src/gpu/ccpr/GrCCClipPath.cpp
@@ -35,8 +35,8 @@
SkASSERT(kTopLeft_GrSurfaceOrigin == textureProxy->origin());
fAtlasScale = {1.f / textureProxy->width(), 1.f / textureProxy->height()};
- fAtlasTranslate = {fAtlasOffsetX * fAtlasScale.x(),
- fAtlasOffsetY * fAtlasScale.y()};
+ fAtlasTranslate.set(fDevToAtlasOffset.fX * fAtlasScale.x(),
+ fDevToAtlasOffset.fY * fAtlasScale.y());
SkDEBUGCODE(fHasAtlasTransform = true);
return sk_ref_sp(textureProxy->priv().peekTexture());
@@ -65,6 +65,6 @@
SkASSERT(this->isInitialized());
SkASSERT(!fHasAtlas);
fAtlas = resources->renderDeviceSpacePathInAtlas(fAccessRect, fDeviceSpacePath, fPathDevIBounds,
- &fAtlasOffsetX, &fAtlasOffsetY);
+ &fDevToAtlasOffset);
SkDEBUGCODE(fHasAtlas = true);
}