Revert "Specialize SkRectanzier to SkRectanizerSkyline"
This reverts commit 77e1f84a84a7d9dd4beae2e7c83ce63f00500cc2.
Reason for revert: breaking google3 roll?
Original change's description:
> Specialize SkRectanzier to SkRectanizerSkyline
>
> It looks like the pow2 rectanizer has never been used. Remove
> the unneeded abstraction for rectanizer everywhere.
>
> Change-Id: Iba33f1c6faf37201d03928ce8409751c212480a0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265983
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,herb@google.com
Change-Id: I2573534f3ea95c98d089f9c19b027564e77015db
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266116
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/gpu/GrDrawOpAtlas.cpp b/src/gpu/GrDrawOpAtlas.cpp
index 6211b71..8f15db9 100644
--- a/src/gpu/GrDrawOpAtlas.cpp
+++ b/src/gpu/GrDrawOpAtlas.cpp
@@ -15,6 +15,7 @@
#include "src/gpu/GrOnFlushResourceProvider.h"
#include "src/gpu/GrOpFlushState.h"
#include "src/gpu/GrProxyProvider.h"
+#include "src/gpu/GrRectanizer.h"
#include "src/gpu/GrResourceProvider.h"
#include "src/gpu/GrResourceProviderPriv.h"
#include "src/gpu/GrSurfaceProxyPriv.h"
@@ -102,7 +103,7 @@
, fHeight(height)
, fX(offX)
, fY(offY)
- , fRectanizer(width, height)
+ , fRects(nullptr)
, fOffset(SkIPoint16::Make(fX * fWidth, fY * fHeight))
, fColorType(colorType)
, fBytesPerPixel(GrColorTypeBytesPerPixel(colorType))
@@ -119,12 +120,17 @@
GrDrawOpAtlas::Plot::~Plot() {
sk_free(fData);
+ delete fRects;
}
bool GrDrawOpAtlas::Plot::addSubImage(int width, int height, const void* image, SkIPoint16* loc) {
SkASSERT(width <= fWidth && height <= fHeight);
- if (!fRectanizer.addRect(width, height, loc)) {
+ if (!fRects) {
+ fRects = GrRectanizer::Factory(fWidth, fHeight);
+ }
+
+ if (!fRects->addRect(width, height, loc)) {
return false;
}
@@ -186,7 +192,9 @@
}
void GrDrawOpAtlas::Plot::resetRects() {
- fRectanizer.reset();
+ if (fRects) {
+ fRects->reset();
+ }
fGenID++;
fID = CreateId(fPageIndex, fPlotIndex, fGenID);