src/gpu: s/SkAutoTUnref/sk_sp/g
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4527
Change-Id: I23f0548f98e7c355da05e143e8baa330d4bc04cc
Reviewed-on: https://skia-review.googlesource.com/4527
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
diff --git a/src/gpu/GrBatchAtlas.cpp b/src/gpu/GrBatchAtlas.cpp
index e478ca1..72808c9 100644
--- a/src/gpu/GrBatchAtlas.cpp
+++ b/src/gpu/GrBatchAtlas.cpp
@@ -136,9 +136,9 @@
SkASSERT(!GrPixelConfigIsCompressed(texture->desc().fConfig));
// set up allocated plots
- fPlotArray = new SkAutoTUnref<BatchPlot>[numPlotsX * numPlotsY];
+ fPlotArray = new sk_sp<BatchPlot>[numPlotsX * numPlotsY];
- SkAutoTUnref<BatchPlot>* currPlot = fPlotArray;
+ sk_sp<BatchPlot>* currPlot = fPlotArray;
for (int y = numPlotsY - 1, r = 0; y >= 0; --y, ++r) {
for (int x = numPlotsX - 1, c = 0; x >= 0; --x, ++c) {
uint32_t index = r * numPlotsX + c;
@@ -230,7 +230,7 @@
this->processEviction(plot->id());
fPlotList.remove(plot);
- SkAutoTUnref<BatchPlot>& newPlot = fPlotArray[plot->index()];
+ sk_sp<BatchPlot>& newPlot = fPlotArray[plot->index()];
newPlot.reset(plot->clone());
fPlotList.addToHead(newPlot.get());
diff --git a/src/gpu/GrBatchAtlas.h b/src/gpu/GrBatchAtlas.h
index 827106f..d8856e8 100644
--- a/src/gpu/GrBatchAtlas.h
+++ b/src/gpu/GrBatchAtlas.h
@@ -69,7 +69,7 @@
SkASSERT(this->hasID(id));
uint32_t index = GetIndexFromID(id);
SkASSERT(index < fNumPlots);
- this->makeMRU(fPlotArray[index]);
+ this->makeMRU(fPlotArray[index].get());
fPlotArray[index]->setLastUseToken(batchToken);
}
@@ -127,7 +127,7 @@
void setLastUseTokenBulk(const BulkUseTokenUpdater& updater, GrBatchDrawToken batchToken) {
int count = updater.fPlotsToUpdate.count();
for (int i = 0; i < count; i++) {
- BatchPlot* plot = fPlotArray[updater.fPlotsToUpdate[i]];
+ BatchPlot* plot = fPlotArray[updater.fPlotsToUpdate[i]].get();
this->makeMRU(plot);
plot->setLastUseToken(batchToken);
}
@@ -254,7 +254,7 @@
SkTDArray<EvictionData> fEvictionCallbacks;
// allocated array of GrBatchPlots
- SkAutoTUnref<BatchPlot>* fPlotArray;
+ sk_sp<BatchPlot>* fPlotArray;
// LRU list of GrPlots (MRU at head - LRU at tail)
GrBatchPlotList fPlotList;
};
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp
index 1c278c3..58d12af 100644
--- a/src/gpu/GrBlurUtils.cpp
+++ b/src/gpu/GrBlurUtils.cpp
@@ -81,14 +81,14 @@
desc.fHeight = dstM.fBounds.height();
desc.fConfig = kAlpha_8_GrPixelConfig;
- SkAutoTUnref<GrTexture> texture(textureProvider->createApproxTexture(desc));
+ sk_sp<GrTexture> texture(textureProvider->createApproxTexture(desc));
if (!texture) {
return false;
}
texture->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig,
dstM.fImage, dstM.fRowBytes);
- return draw_mask(renderTargetContext, clipData, viewMatrix, dstM.fBounds, grp, texture);
+ return draw_mask(renderTargetContext, clipData, viewMatrix, dstM.fBounds, grp, texture.get());
}
// Create a mask of 'devPath' and place the result in 'mask'.
@@ -215,7 +215,7 @@
if (maskFilter->filterMaskGPU(mask.get(), viewMatrix, finalIRect, &filtered)) {
// filterMaskGPU gives us ownership of a ref to the result
- SkAutoTUnref<GrTexture> atu(filtered);
+ sk_sp<GrTexture> atu(filtered);
if (draw_mask(renderTargetContext, clip, viewMatrix, finalIRect, paint, filtered)) {
// This path is completely drawn
return;
diff --git a/src/gpu/GrClipStackClip.h b/src/gpu/GrClipStackClip.h
index 4e99955..afda3eb 100644
--- a/src/gpu/GrClipStackClip.h
+++ b/src/gpu/GrClipStackClip.h
@@ -64,8 +64,8 @@
static GrTexture* CreateCachedMask(int width, int height, const GrUniqueKey& key,
bool renderTarget);
- SkIPoint fOrigin;
- SkAutoTUnref<const SkClipStack> fStack;
+ SkIPoint fOrigin;
+ sk_sp<const SkClipStack> fStack;
};
#endif // GrClipStackClip_DEFINED
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index aabe8fb..13d1f3d 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -289,7 +289,7 @@
this->flush();
}
- SkAutoTUnref<GrTexture> tempTexture;
+ sk_sp<GrTexture> tempTexture;
if (GrGpu::kNoDraw_DrawPreference != drawPreference) {
tempTexture.reset(
this->textureProvider()->createApproxTexture(tempDrawInfo.fTempSurfaceDesc));
@@ -305,7 +305,7 @@
SkMatrix textureMatrix;
textureMatrix.setIDiv(tempTexture->width(), tempTexture->height());
if (applyPremulToSrc) {
- fp = this->createUPMToPMEffect(tempTexture, tempDrawInfo.fSwizzle, textureMatrix);
+ fp = this->createUPMToPMEffect(tempTexture.get(), tempDrawInfo.fSwizzle, textureMatrix);
// If premultiplying was the only reason for the draw, fall back to a straight write.
if (!fp) {
if (GrGpu::kCallerPrefersDraw_DrawPreference == drawPreference) {
@@ -317,7 +317,7 @@
}
if (tempTexture) {
if (!fp) {
- fp = GrConfigConversionEffect::Make(tempTexture, tempDrawInfo.fSwizzle,
+ fp = GrConfigConversionEffect::Make(tempTexture.get(), tempDrawInfo.fSwizzle,
GrConfigConversionEffect::kNone_PMConversion,
textureMatrix);
if (!fp) {
@@ -340,7 +340,7 @@
buffer = tmpPixels.get();
applyPremulToSrc = false;
}
- if (!fGpu->writePixels(tempTexture, 0, 0, width, height,
+ if (!fGpu->writePixels(tempTexture.get(), 0, 0, width, height,
tempDrawInfo.fWriteConfig, buffer,
rowBytes)) {
return false;
@@ -429,7 +429,7 @@
return false;
}
- SkAutoTUnref<GrSurface> surfaceToRead(SkRef(src));
+ sk_sp<GrSurface> surfaceToRead(SkRef(src));
bool didTempDraw = false;
if (GrGpu::kNoDraw_DrawPreference != drawPreference) {
if (SkBackingFit::kExact == tempDrawInfo.fTempSurfaceFit) {
@@ -491,11 +491,11 @@
}
GrPixelConfig configToRead = dstConfig;
if (didTempDraw) {
- this->flushSurfaceWrites(surfaceToRead);
+ this->flushSurfaceWrites(surfaceToRead.get());
configToRead = tempDrawInfo.fReadConfig;
}
- if (!fGpu->readPixels(surfaceToRead, left, top, width, height, configToRead, buffer,
- rowBytes)) {
+ if (!fGpu->readPixels(surfaceToRead.get(), left, top, width, height, configToRead, buffer,
+ rowBytes)) {
return false;
}
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 9a74560..686820e 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -516,7 +516,7 @@
Stats fStats;
std::unique_ptr<GrPathRendering> fPathRendering;
// Subclass must initialize this in its constructor.
- SkAutoTUnref<const GrCaps> fCaps;
+ sk_sp<const GrCaps> fCaps;
typedef SkTArray<SkPoint, true> SamplePattern;
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index d04502e..e7a8900 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -819,10 +819,10 @@
}
// Setup geometry processor
- SkAutoTUnref<GrGeometryProcessor> gp(new CircleGeometryProcessor(!fAllFill, fClipPlane,
- fClipPlaneIsect,
- fClipPlaneUnion,
- localMatrix));
+ sk_sp<GrGeometryProcessor> gp(new CircleGeometryProcessor(!fAllFill, fClipPlane,
+ fClipPlaneIsect,
+ fClipPlaneUnion,
+ localMatrix));
struct CircleVertex {
SkPoint fPos;
@@ -1258,7 +1258,7 @@
}
// Setup geometry processor
- SkAutoTUnref<GrGeometryProcessor> gp(new EllipseGeometryProcessor(fStroked, localMatrix));
+ sk_sp<GrGeometryProcessor> gp(new EllipseGeometryProcessor(fStroked, localMatrix));
int instanceCount = fGeoData.count();
QuadHelper helper;
@@ -1316,7 +1316,7 @@
verts += kVerticesPerQuad;
}
- helper.recordDraw(target, gp);
+ helper.recordDraw(target, gp.get());
}
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
@@ -1462,8 +1462,8 @@
void onPrepareDraws(Target* target) const override {
// Setup geometry processor
- SkAutoTUnref<GrGeometryProcessor> gp(new DIEllipseGeometryProcessor(this->viewMatrix(),
- this->style()));
+ sk_sp<GrGeometryProcessor> gp(new DIEllipseGeometryProcessor(this->viewMatrix(),
+ this->style()));
int instanceCount = fGeoData.count();
size_t vertexStride = gp->getVertexStride();
@@ -1513,7 +1513,7 @@
verts += kVerticesPerQuad;
}
- helper.recordDraw(target, gp);
+ helper.recordDraw(target, gp.get());
}
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
@@ -1857,9 +1857,9 @@
}
// Setup geometry processor
- SkAutoTUnref<GrGeometryProcessor> gp(new CircleGeometryProcessor(!fAllFill,
- false, false,
- false, localMatrix));
+ sk_sp<GrGeometryProcessor> gp(new CircleGeometryProcessor(!fAllFill,
+ false, false,
+ false, localMatrix));
int instanceCount = fGeoData.count();
size_t vertexStride = gp->getVertexStride();
@@ -2129,7 +2129,7 @@
}
// Setup geometry processor
- SkAutoTUnref<GrGeometryProcessor> gp(new EllipseGeometryProcessor(fStroked, localMatrix));
+ sk_sp<GrGeometryProcessor> gp(new EllipseGeometryProcessor(fStroked, localMatrix));
int instanceCount = fGeoData.count();
size_t vertexStride = gp->getVertexStride();
@@ -2137,13 +2137,13 @@
// drop out the middle quad if we're stroked
int indicesPerInstance = fStroked ? kIndicesPerStrokeRRect : kIndicesPerFillRRect;
- SkAutoTUnref<const GrBuffer> indexBuffer(
+ sk_sp<const GrBuffer> indexBuffer(
ref_rrect_index_buffer(fStroked ? kStroke_RRectType : kFill_RRectType,
target->resourceProvider()));
InstancedHelper helper;
EllipseVertex* verts = reinterpret_cast<EllipseVertex*>(
- helper.init(target, kTriangles_GrPrimitiveType, vertexStride, indexBuffer,
+ helper.init(target, kTriangles_GrPrimitiveType, vertexStride, indexBuffer.get(),
kVertsPerStandardRRect, indicesPerInstance, instanceCount));
if (!verts || !indexBuffer) {
SkDebugf("Could not allocate vertices\n");
@@ -2210,7 +2210,7 @@
verts++;
}
}
- helper.recordDraw(target, gp);
+ helper.recordDraw(target, gp.get());
}
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
diff --git a/src/gpu/GrPathRange.h b/src/gpu/GrPathRange.h
index 7bca17f..39779a7 100644
--- a/src/gpu/GrPathRange.h
+++ b/src/gpu/GrPathRange.h
@@ -143,7 +143,7 @@
kPathsPerGroup = 16 // Paths get tracked in groups of 16 for lazy loading.
};
- mutable SkAutoTUnref<PathGenerator> fPathGenerator;
+ mutable sk_sp<PathGenerator> fPathGenerator;
mutable SkTArray<uint8_t, true /*MEM_COPY*/> fGeneratedPaths;
const int fNumPaths;
diff --git a/src/gpu/GrPathRendering.cpp b/src/gpu/GrPathRendering.cpp
index 933f0fb..a859d10 100644
--- a/src/gpu/GrPathRendering.cpp
+++ b/src/gpu/GrPathRendering.cpp
@@ -84,8 +84,8 @@
}
if (desc) {
- SkAutoTUnref<GlyphGenerator> generator(new GlyphGenerator(*typeface, effects, *desc));
- return this->createPathRange(generator, style);
+ sk_sp<GlyphGenerator> generator(new GlyphGenerator(*typeface, effects, *desc));
+ return this->createPathRange(generator.get(), style);
}
SkScalerContextRec rec;
@@ -105,6 +105,6 @@
// No effects, so we make a dummy struct
SkScalerContextEffects noEffects;
- SkAutoTUnref<GlyphGenerator> generator(new GlyphGenerator(*typeface, noEffects, *genericDesc));
- return this->createPathRange(generator, style);
+ sk_sp<GlyphGenerator> generator(new GlyphGenerator(*typeface, noEffects, *genericDesc));
+ return this->createPathRange(generator.get(), style);
}
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index 0ac17e7..875c50e 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -59,7 +59,7 @@
bool hasMixedSamples = args.fRenderTargetContext->hasMixedSamples() &&
(builder.isHWAntialias() || pipeline->isStencilEnabled());
const GrXPFactory* xpFactory = builder.getXPFactory();
- SkAutoTUnref<GrXferProcessor> xferProcessor;
+ sk_sp<GrXferProcessor> xferProcessor;
if (xpFactory) {
xferProcessor.reset(xpFactory->createXferProcessor(args.fOpts,
hasMixedSamples,
@@ -104,7 +104,7 @@
overrideColor = GrColor_ILLEGAL;
}
- pipeline->fXferProcessor.reset(xferProcessor);
+ pipeline->fXferProcessor.reset(xferProcessor.get());
int firstColorProcessorIdx = args.fOpts.fColorPOI.firstEffectiveProcessorIndex();
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index ad8adb0..f1f17b0 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -403,7 +403,7 @@
return true;
}
- SkAutoTUnref<GrDrawBatch> batch;
+ sk_sp<GrDrawBatch> batch;
bool useHWAA;
if (GrCaps::InstancedSupport::kNone != fContext->caps()->instancedSupport()) {
@@ -416,7 +416,7 @@
if (ss) {
pipelineBuilder.setUserStencil(ss);
}
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
return true;
}
}
@@ -434,7 +434,7 @@
if (ss) {
pipelineBuilder.setUserStencil(ss);
}
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
return true;
}
}
@@ -534,7 +534,7 @@
bool useHWAA;
bool snapToPixelCenters = false;
- SkAutoTUnref<GrDrawBatch> batch;
+ sk_sp<GrDrawBatch> batch;
GrColor color = paint.getColor();
if (should_apply_coverage_aa(paint, fRenderTargetProxy.get(), &useHWAA)) {
@@ -560,7 +560,7 @@
snapToPixelCenters);
}
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
return;
}
}
@@ -663,12 +663,12 @@
if (GrCaps::InstancedSupport::kNone != fContext->caps()->instancedSupport()) {
InstancedRendering* ir = this->getOpList()->instancedRendering();
- SkAutoTUnref<GrDrawBatch> batch(ir->recordRect(croppedRect, viewMatrix, paint.getColor(),
- croppedLocalRect, paint.isAntiAlias(),
- fInstancedPipelineInfo, &useHWAA));
+ sk_sp<GrDrawBatch> batch(ir->recordRect(croppedRect, viewMatrix, paint.getColor(),
+ croppedLocalRect, paint.isAntiAlias(),
+ fInstancedPipelineInfo, &useHWAA));
if (batch) {
GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
return;
}
}
@@ -680,12 +680,12 @@
}
if (view_matrix_ok_for_aa_fill_rect(viewMatrix)) {
- SkAutoTUnref<GrDrawBatch> batch(GrAAFillRectBatch::CreateWithLocalRect(paint.getColor(),
- viewMatrix,
- croppedRect,
- croppedLocalRect));
+ sk_sp<GrDrawBatch> batch(GrAAFillRectBatch::CreateWithLocalRect(paint.getColor(),
+ viewMatrix,
+ croppedRect,
+ croppedLocalRect));
GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->drawBatch(pipelineBuilder, clip, batch);
+ this->drawBatch(pipelineBuilder, clip, batch.get());
return;
}
@@ -722,12 +722,12 @@
if (GrCaps::InstancedSupport::kNone != fContext->caps()->instancedSupport()) {
InstancedRendering* ir = this->getOpList()->instancedRendering();
- SkAutoTUnref<GrDrawBatch> batch(ir->recordRect(croppedRect, viewMatrix, paint.getColor(),
+ sk_sp<GrDrawBatch> batch(ir->recordRect(croppedRect, viewMatrix, paint.getColor(),
localMatrix, paint.isAntiAlias(),
fInstancedPipelineInfo, &useHWAA));
if (batch) {
GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
return;
}
}
@@ -739,10 +739,10 @@
}
if (view_matrix_ok_for_aa_fill_rect(viewMatrix)) {
- SkAutoTUnref<GrDrawBatch> batch(GrAAFillRectBatch::Create(paint.getColor(), viewMatrix,
- localMatrix, croppedRect));
+ sk_sp<GrDrawBatch> batch(GrAAFillRectBatch::Create(paint.getColor(), viewMatrix,
+ localMatrix, croppedRect));
GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
return;
}
@@ -786,13 +786,13 @@
viewMatrix.mapRect(&bounds);
- SkAutoTUnref<GrDrawBatch> batch(new GrDrawVerticesBatch(paint.getColor(),
- primitiveType, viewMatrix, positions,
- vertexCount, indices, indexCount,
- colors, texCoords, bounds));
+ sk_sp<GrDrawBatch> batch(new GrDrawVerticesBatch(paint.getColor(),
+ primitiveType, viewMatrix, positions,
+ vertexCount, indices, indexCount,
+ colors, texCoords, bounds));
GrPipelineBuilder pipelineBuilder(paint, this->mustUseHWAA(paint));
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
}
///////////////////////////////////////////////////////////////////////////////
@@ -811,11 +811,11 @@
AutoCheckFlush acf(fDrawingManager);
- SkAutoTUnref<GrDrawBatch> batch(new GrDrawAtlasBatch(paint.getColor(), viewMatrix, spriteCount,
+ sk_sp<GrDrawBatch> batch(new GrDrawAtlasBatch(paint.getColor(), viewMatrix, spriteCount,
xform, texRect, colors));
GrPipelineBuilder pipelineBuilder(paint, this->mustUseHWAA(paint));
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
}
///////////////////////////////////////////////////////////////////////////////
@@ -855,28 +855,27 @@
if (GrCaps::InstancedSupport::kNone != fContext->caps()->instancedSupport() &&
stroke.isFillStyle()) {
InstancedRendering* ir = this->getOpList()->instancedRendering();
- SkAutoTUnref<GrDrawBatch> batch(ir->recordRRect(rrect, viewMatrix, paint.getColor(),
- paint.isAntiAlias(), fInstancedPipelineInfo,
- &useHWAA));
+ sk_sp<GrDrawBatch> batch(ir->recordRRect(rrect, viewMatrix, paint.getColor(),
+ paint.isAntiAlias(), fInstancedPipelineInfo,
+ &useHWAA));
if (batch) {
GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->getOpList()->drawBatch(pipelineBuilder, this, *clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, *clip, batch.get());
return;
}
}
if (should_apply_coverage_aa(paint, fRenderTargetProxy.get(), &useHWAA)) {
GrShaderCaps* shaderCaps = fContext->caps()->shaderCaps();
- SkAutoTUnref<GrDrawBatch> batch(GrOvalRenderer::CreateRRectBatch(
- paint.getColor(),
- paint.usesDistanceVectorField(),
- viewMatrix,
- rrect,
- stroke,
- shaderCaps));
+ sk_sp<GrDrawBatch> batch(GrOvalRenderer::CreateRRectBatch(paint.getColor(),
+ paint.usesDistanceVectorField(),
+ viewMatrix,
+ rrect,
+ stroke,
+ shaderCaps));
if (batch) {
GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->getOpList()->drawBatch(pipelineBuilder, this, *clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, *clip, batch.get());
return;
}
}
@@ -898,12 +897,12 @@
if (GrCaps::InstancedSupport::kNone != fContext->caps()->instancedSupport()) {
bool useHWAA;
InstancedRendering* ir = this->getOpList()->instancedRendering();
- SkAutoTUnref<GrDrawBatch> batch(ir->recordDRRect(origOuter, origInner, viewMatrix,
- paintIn.getColor(), paintIn.isAntiAlias(),
- fInstancedPipelineInfo, &useHWAA));
+ sk_sp<GrDrawBatch> batch(ir->recordDRRect(origOuter, origInner, viewMatrix,
+ paintIn.getColor(), paintIn.isAntiAlias(),
+ fInstancedPipelineInfo, &useHWAA));
if (batch) {
GrPipelineBuilder pipelineBuilder(paintIn, useHWAA);
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
return true;
}
}
@@ -1011,9 +1010,9 @@
return this->drawPath(clip, paint, viewMatrix, path, style);
}
- SkAutoTUnref<GrDrawBatch> batch(GrRegionBatch::Create(paint.getColor(), viewMatrix, region));
+ sk_sp<GrDrawBatch> batch(GrRegionBatch::Create(paint.getColor(), viewMatrix, region));
GrPipelineBuilder pipelineBuilder(paint, false);
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
}
void GrRenderTargetContext::drawOval(const GrClip& clip,
@@ -1039,26 +1038,26 @@
if (GrCaps::InstancedSupport::kNone != fContext->caps()->instancedSupport() &&
stroke.isFillStyle()) {
InstancedRendering* ir = this->getOpList()->instancedRendering();
- SkAutoTUnref<GrDrawBatch> batch(ir->recordOval(oval, viewMatrix, paint.getColor(),
- paint.isAntiAlias(), fInstancedPipelineInfo,
- &useHWAA));
+ sk_sp<GrDrawBatch> batch(ir->recordOval(oval, viewMatrix, paint.getColor(),
+ paint.isAntiAlias(), fInstancedPipelineInfo,
+ &useHWAA));
if (batch) {
GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
return;
}
}
if (should_apply_coverage_aa(paint, fRenderTargetProxy.get(), &useHWAA)) {
GrShaderCaps* shaderCaps = fContext->caps()->shaderCaps();
- SkAutoTUnref<GrDrawBatch> batch(GrOvalRenderer::CreateOvalBatch(paint.getColor(),
- viewMatrix,
- oval,
- stroke,
- shaderCaps));
+ sk_sp<GrDrawBatch> batch(GrOvalRenderer::CreateOvalBatch(paint.getColor(),
+ viewMatrix,
+ oval,
+ stroke,
+ shaderCaps));
if (batch) {
GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
return;
}
}
@@ -1080,17 +1079,17 @@
bool useHWAA;
if (should_apply_coverage_aa(paint, fRenderTargetProxy.get(), &useHWAA)) {
GrShaderCaps* shaderCaps = fContext->caps()->shaderCaps();
- SkAutoTUnref<GrDrawBatch> batch(GrOvalRenderer::CreateArcBatch(paint.getColor(),
- viewMatrix,
- oval,
- startAngle,
- sweepAngle,
- useCenter,
- style,
- shaderCaps));
+ sk_sp<GrDrawBatch> batch(GrOvalRenderer::CreateArcBatch(paint.getColor(),
+ viewMatrix,
+ oval,
+ startAngle,
+ sweepAngle,
+ useCenter,
+ style,
+ shaderCaps));
if (batch) {
GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
return;
}
}
@@ -1115,12 +1114,12 @@
AutoCheckFlush acf(fDrawingManager);
- SkAutoTUnref<GrDrawBatch> batch(GrNinePatch::CreateNonAA(paint.getColor(), viewMatrix,
- imageWidth, imageHeight,
- std::move(iter), dst));
+ sk_sp<GrDrawBatch> batch(GrNinePatch::CreateNonAA(paint.getColor(), viewMatrix,
+ imageWidth, imageHeight,
+ std::move(iter), dst));
GrPipelineBuilder pipelineBuilder(paint, this->mustUseHWAA(paint));
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
}
void GrRenderTargetContext::prepareForExternalIO() {
@@ -1147,14 +1146,14 @@
const GrUserStencilSettings* ss,
bool useHWAA) {
SkASSERT(!useHWAA || this->isStencilBufferMultisampled());
- SkAutoTUnref<GrDrawBatch> batch(
+ sk_sp<GrDrawBatch> batch(
GrRectBatchFactory::CreateNonAAFill(paint.getColor(), viewMatrix, rect, localRect,
localMatrix));
GrPipelineBuilder pipelineBuilder(paint, useHWAA);
if (ss) {
pipelineBuilder.setUserStencil(ss);
}
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
}
bool GrRenderTargetContext::readPixels(const SkImageInfo& dstInfo, void* dstBuffer,
@@ -1271,11 +1270,11 @@
SkRect rects[2];
if (fills_as_nested_rects(viewMatrix, path, rects)) {
- SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateAAFillNestedRects(
+ sk_sp<GrDrawBatch> batch(GrRectBatchFactory::CreateAAFillNestedRects(
paint.getColor(), viewMatrix, rects));
if (batch) {
GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
}
return;
}
@@ -1285,14 +1284,14 @@
if (isOval && !path.isInverseFillType()) {
GrShaderCaps* shaderCaps = fContext->caps()->shaderCaps();
- SkAutoTUnref<GrDrawBatch> batch(GrOvalRenderer::CreateOvalBatch(paint.getColor(),
- viewMatrix,
- ovalRect,
- style.strokeRec(),
- shaderCaps));
+ sk_sp<GrDrawBatch> batch(GrOvalRenderer::CreateOvalBatch(paint.getColor(),
+ viewMatrix,
+ ovalRect,
+ style.strokeRec(),
+ shaderCaps));
if (batch) {
GrPipelineBuilder pipelineBuilder(paint, useHWAA);
- this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch);
+ this->getOpList()->drawBatch(pipelineBuilder, this, clip, batch.get());
return;
}
}
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index 2671630..9430efb 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -194,8 +194,8 @@
maskMatrix,
GrTextureParams::kNone_FilterMode));
- SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(paint.getColor(),
- SkMatrix::I(),
- dstRect, nullptr, &invert));
- renderTargetContext->drawBatch(pipelineBuilder, clip, batch);
+ sk_sp<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(paint.getColor(),
+ SkMatrix::I(),
+ dstRect, nullptr, &invert));
+ renderTargetContext->drawBatch(pipelineBuilder, clip, batch.get());
}
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index ec4bfe0..55aae87 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -67,14 +67,14 @@
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkMatrix& localMatrix) {
- SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(paint.getColor(),
- viewMatrix, rect,
- nullptr, &localMatrix));
+ sk_sp<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(paint.getColor(),
+ viewMatrix, rect,
+ nullptr, &localMatrix));
GrPipelineBuilder pipelineBuilder(paint, renderTargetContext->mustUseHWAA(paint));
pipelineBuilder.setUserStencil(&userStencilSettings);
- renderTargetContext->drawBatch(pipelineBuilder, clip, batch);
+ renderTargetContext->drawBatch(pipelineBuilder, clip, batch.get());
}
void GrSoftwarePathRenderer::DrawAroundInvPath(GrRenderTargetContext* renderTargetContext,
diff --git a/src/gpu/GrTextureParamsAdjuster.cpp b/src/gpu/GrTextureParamsAdjuster.cpp
index b4f5e68..43bfec8 100644
--- a/src/gpu/GrTextureParamsAdjuster.cpp
+++ b/src/gpu/GrTextureParamsAdjuster.cpp
@@ -388,13 +388,13 @@
if (filterOrNullForBicubic) {
params.setFilterMode(*filterOrNullForBicubic);
}
- SkAutoTUnref<GrTexture> texture(this->refTextureSafeForParams(params, gammaTreatment, nullptr));
+ sk_sp<GrTexture> texture(this->refTextureSafeForParams(params, gammaTreatment, nullptr));
if (!texture) {
return nullptr;
}
// If we made a copy then we only copied the contentArea, in which case the new texture is all
// content.
- if (texture != this->originalTexture()) {
+ if (texture.get() != this->originalTexture()) {
contentArea = nullptr;
}
@@ -423,7 +423,7 @@
textureMatrix.postIDiv(texture->width(), texture->height());
sk_sp<GrColorSpaceXform> colorSpaceXform = GrColorSpaceXform::Make(this->getColorSpace(),
dstColorSpace);
- return create_fp_for_domain_and_filter(texture, std::move(colorSpaceXform), textureMatrix,
+ return create_fp_for_domain_and_filter(texture.get(), std::move(colorSpaceXform), textureMatrix,
domainMode, domain, filterOrNullForBicubic);
}
@@ -491,7 +491,7 @@
// Bicubic doesn't use filtering for it's texture accesses.
params.reset(SkShader::kClamp_TileMode, GrTextureParams::kNone_FilterMode);
}
- SkAutoTUnref<GrTexture> texture(this->refTextureForParams(params, gammaTreatment));
+ sk_sp<GrTexture> texture(this->refTextureForParams(params, gammaTreatment));
if (!texture) {
return nullptr;
}
@@ -505,16 +505,16 @@
normalizedTextureMatrix.postIDiv(texture->width(), texture->height());
sk_sp<GrColorSpaceXform> colorSpaceXform = GrColorSpaceXform::Make(this->getColorSpace(),
dstColorSpace);
- return create_fp_for_domain_and_filter(texture, std::move(colorSpaceXform),
+ return create_fp_for_domain_and_filter(texture.get(), std::move(colorSpaceXform),
normalizedTextureMatrix, domainMode, domain,
filterOrNullForBicubic);
}
GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams, bool willBeMipped,
SkSourceGammaTreatment gammaTreatment) {
- SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped, gammaTreatment));
+ sk_sp<GrTexture> original(this->refOriginalTexture(willBeMipped, gammaTreatment));
if (!original) {
return nullptr;
}
- return copy_on_gpu(original, nullptr, copyParams);
+ return copy_on_gpu(original.get(), nullptr, copyParams);
}
diff --git a/src/gpu/GrYUVProvider.cpp b/src/gpu/GrYUVProvider.cpp
index e12e268..13e84da 100644
--- a/src/gpu/GrYUVProvider.cpp
+++ b/src/gpu/GrYUVProvider.cpp
@@ -28,8 +28,8 @@
private:
// we only use one or the other of these
- SkAutoTUnref<SkCachedData> fCachedData;
- SkAutoMalloc fStorage;
+ sk_sp<SkCachedData> fCachedData;
+ SkAutoMalloc fStorage;
};
}
@@ -75,7 +75,7 @@
if (useCache) {
// Decoding is done, cache the resulting YUV planes
- SkYUVPlanesCache::Add(provider->onGetID(), fCachedData, yuvInfo);
+ SkYUVPlanesCache::Add(provider->onGetID(), fCachedData.get(), yuvInfo);
}
}
return true;
@@ -93,7 +93,7 @@
GrSurfaceDesc yuvDesc;
yuvDesc.fConfig = kAlpha_8_GrPixelConfig;
- SkAutoTUnref<GrTexture> yuvTextures[3];
+ sk_sp<GrTexture> yuvTextures[3];
for (int i = 0; i < 3; i++) {
yuvDesc.fWidth = yuvInfo.fSizeInfo.fSizes[i].fWidth;
yuvDesc.fHeight = yuvInfo.fSizeInfo.fSizes[i].fHeight;
@@ -125,7 +125,7 @@
GrPaint paint;
sk_sp<GrFragmentProcessor> yuvToRgbProcessor(
- GrYUVEffect::MakeYUVToRGB(yuvTextures[0], yuvTextures[1], yuvTextures[2],
+ GrYUVEffect::MakeYUVToRGB(yuvTextures[0].get(), yuvTextures[1].get(), yuvTextures[2].get(),
yuvInfo.fSizeInfo.fSizes, yuvInfo.fColorSpace, false));
paint.addColorFragmentProcessor(std::move(yuvToRgbProcessor));
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index b8a520f..19c6377 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -191,7 +191,7 @@
SkMatrix matrix = *draw.fMatrix;
matrix.postTranslate(SkIntToScalar(-left), SkIntToScalar(-top));
const SkIRect clipBounds = draw.fRC->getBounds().makeOffset(-left, -top);
- SkAutoTUnref<SkImageFilterCache> cache(this->getImageFilterCache());
+ sk_sp<SkImageFilterCache> cache(this->getImageFilterCache());
SkImageFilter::OutputProperties outputProperties(fRenderTargetContext->getColorSpace());
SkImageFilter::Context ctx(matrix, clipBounds, cache.get(), outputProperties);
@@ -235,7 +235,7 @@
void SkGpuDevice::clearAll() {
ASSERT_SINGLE_OWNER
GrColor color = 0;
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "clearAll", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "clearAll", fContext.get());
SkIRect rect = SkIRect::MakeWH(this->width(), this->height());
fRenderTargetContext->clear(&rect, color, true);
}
@@ -273,7 +273,7 @@
void SkGpuDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) {
ASSERT_SINGLE_OWNER
CHECK_SHOULD_DRAW(draw);
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPaint", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPaint", fContext.get());
GrPaint grPaint;
if (!SkPaintToGrPaint(this->context(), fRenderTargetContext.get(), paint, *draw.fMatrix,
@@ -316,7 +316,7 @@
void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode,
size_t count, const SkPoint pts[], const SkPaint& paint) {
ASSERT_SINGLE_OWNER
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPoints", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPoints", fContext.get());
CHECK_SHOULD_DRAW(draw);
SkScalar width = paint.getStrokeWidth();
@@ -388,7 +388,7 @@
void SkGpuDevice::drawRect(const SkDraw& draw, const SkRect& rect, const SkPaint& paint) {
ASSERT_SINGLE_OWNER
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawRect", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawRect", fContext.get());
CHECK_SHOULD_DRAW(draw);
@@ -397,7 +397,7 @@
SkPath path;
path.setIsVolatile(true);
path.addRect(rect);
- GrBlurUtils::drawPathWithMaskFilter(fContext, fRenderTargetContext.get(),
+ GrBlurUtils::drawPathWithMaskFilter(fContext.get(), fRenderTargetContext.get(),
fClip, path, paint,
*draw.fMatrix, nullptr,
draw.fRC->getBounds(), true);
@@ -419,7 +419,7 @@
void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rrect,
const SkPaint& paint) {
ASSERT_SINGLE_OWNER
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawRRect", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawRRect", fContext.get());
CHECK_SHOULD_DRAW(draw);
GrPaint grPaint;
@@ -449,9 +449,9 @@
// clipped out
return;
}
- if (mf->directFilterRRectMaskGPU(fContext, fRenderTargetContext.get(), &grPaint,
- fClip, *draw.fMatrix, style.strokeRec(), rrect,
- devRRect)) {
+ if (mf->directFilterRRectMaskGPU(fContext.get(), fRenderTargetContext.get(),
+ &grPaint, fClip, *draw.fMatrix,
+ style.strokeRec(), rrect, devRRect)) {
return;
}
}
@@ -467,7 +467,7 @@
SkPath path;
path.setIsVolatile(true);
path.addRRect(rrect);
- GrBlurUtils::drawPathWithMaskFilter(fContext, fRenderTargetContext.get(),
+ GrBlurUtils::drawPathWithMaskFilter(fContext.get(), fRenderTargetContext.get(),
fClip, path, paint,
*draw.fMatrix, nullptr,
draw.fRC->getBounds(), true);
@@ -483,7 +483,7 @@
void SkGpuDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer,
const SkRRect& inner, const SkPaint& paint) {
ASSERT_SINGLE_OWNER
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawDRRect", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawDRRect", fContext.get());
CHECK_SHOULD_DRAW(draw);
if (outer.isEmpty()) {
@@ -513,7 +513,7 @@
path.addRRect(inner);
path.setFillType(SkPath::kEvenOdd_FillType);
- GrBlurUtils::drawPathWithMaskFilter(fContext, fRenderTargetContext.get(),
+ GrBlurUtils::drawPathWithMaskFilter(fContext.get(), fRenderTargetContext.get(),
fClip, path, paint,
*draw.fMatrix, nullptr,
draw.fRC->getBounds(), true);
@@ -540,7 +540,7 @@
void SkGpuDevice::drawOval(const SkDraw& draw, const SkRect& oval, const SkPaint& paint) {
ASSERT_SINGLE_OWNER
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawOval", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawOval", fContext.get());
CHECK_SHOULD_DRAW(draw);
// Presumably the path effect warps this to something other than an oval
@@ -570,7 +570,7 @@
void SkGpuDevice::drawArc(const SkDraw& draw, const SkRect& oval, SkScalar startAngle,
SkScalar sweepAngle, bool useCenter, const SkPaint& paint) {
ASSERT_SINGLE_OWNER
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawArc", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawArc", fContext.get());
CHECK_SHOULD_DRAW(draw);
if (paint.getMaskFilter()) {
@@ -594,7 +594,7 @@
const SkDraw& draw,
const SkPaint& origPaint) {
ASSERT_SINGLE_OWNER
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawStrokedLine", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawStrokedLine", fContext.get());
CHECK_SHOULD_DRAW(draw);
// Adding support for round capping would require a
@@ -679,9 +679,9 @@
}
CHECK_SHOULD_DRAW(draw);
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPath", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPath", fContext.get());
- GrBlurUtils::drawPathWithMaskFilter(fContext, fRenderTargetContext.get(),
+ GrBlurUtils::drawPathWithMaskFilter(fContext.get(), fRenderTargetContext.get(),
fClip, origSrcPath, paint,
*draw.fMatrix, prePathMatrix,
draw.fRC->getBounds(), pathIsMutable);
@@ -881,7 +881,7 @@
return;
}
}
- GrBitmapTextureMaker maker(fContext, bitmap);
+ GrBitmapTextureMaker maker(fContext.get(), bitmap);
this->drawTextureProducer(&maker, nullptr, nullptr, SkCanvas::kStrict_SrcRectConstraint,
viewMatrix, fClip, paint);
}
@@ -1033,7 +1033,7 @@
bitmap.height() <= fContext->caps()->maxTileSize());
sk_sp<GrTexture> texture = GrMakeCachedBitmapTexture(
- fContext, bitmap, params, fRenderTargetContext->sourceGammaTreatment());
+ fContext.get(), bitmap, params, fRenderTargetContext->sourceGammaTreatment());
if (nullptr == texture) {
return;
}
@@ -1097,7 +1097,7 @@
int left, int top, const SkPaint& paint) {
ASSERT_SINGLE_OWNER
CHECK_SHOULD_DRAW(draw);
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawSprite", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawSprite", fContext.get());
if (fContext->abandoned()) {
return;
@@ -1111,7 +1111,7 @@
}
// draw sprite neither filters nor tiles.
- texture.reset(GrRefCachedBitmapTexture(fContext, bitmap,
+ texture.reset(GrRefCachedBitmapTexture(fContext.get(), bitmap,
GrTextureParams::ClampNoFilter(),
SkSourceGammaTreatment::kRespect));
if (!texture) {
@@ -1140,7 +1140,7 @@
const SkPaint& paint) {
ASSERT_SINGLE_OWNER
CHECK_SHOULD_DRAW(draw);
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawSpecial", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawSpecial", fContext.get());
SkIPoint offset = { 0, 0 };
@@ -1157,7 +1157,7 @@
}
SkASSERT(result->isTextureBacked());
- sk_sp<GrTexture> texture = result->asTextureRef(fContext);
+ sk_sp<GrTexture> texture = result->asTextureRef(fContext.get());
SkPaint tmpUnfiltered(paint);
tmpUnfiltered.setImageFilter(nullptr);
@@ -1269,7 +1269,7 @@
return;
}
}
- GrBitmapTextureMaker maker(fContext, bitmap);
+ GrBitmapTextureMaker maker(fContext.get(), bitmap);
this->drawTextureProducer(&maker, src, dst, constraint, *draw.fMatrix, fClip, paint);
}
@@ -1279,7 +1279,7 @@
return nullptr;
}
- sk_sp<GrTexture> texture = GrMakeCachedBitmapTexture(fContext, bitmap,
+ sk_sp<GrTexture> texture = GrMakeCachedBitmapTexture(fContext.get(), bitmap,
GrTextureParams::ClampNoFilter(),
SkSourceGammaTreatment::kRespect);
if (!texture) {
@@ -1347,7 +1347,7 @@
ASSERT_SINGLE_OWNER
// clear of the source device must occur before CHECK_SHOULD_DRAW
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawDevice", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawDevice", fContext.get());
// drawDevice is defined to be in device coords.
CHECK_SHOULD_DRAW(draw);
@@ -1385,7 +1385,7 @@
this->drawBitmap(draw, bm, SkMatrix::MakeTrans(x, y), paint);
} else if (SkImageCacherator* cacher = as_IB(image)->peekCacherator()) {
CHECK_SHOULD_DRAW(draw);
- GrImageTextureMaker maker(fContext, cacher, image, SkImage::kAllow_CachingHint);
+ GrImageTextureMaker maker(fContext.get(), cacher, image, SkImage::kAllow_CachingHint);
this->drawTextureProducer(&maker, nullptr, nullptr, SkCanvas::kFast_SrcRectConstraint,
viewMatrix, fClip, paint);
} else if (as_IB(image)->getROPixels(&bm)) {
@@ -1419,7 +1419,7 @@
this->drawBitmapRect(draw, bm, src, dst, paint, constraint);
} else if (SkImageCacherator* cacher = as_IB(image)->peekCacherator()) {
CHECK_SHOULD_DRAW(draw);
- GrImageTextureMaker maker(fContext, cacher, image, SkImage::kAllow_CachingHint);
+ GrImageTextureMaker maker(fContext.get(), cacher, image, SkImage::kAllow_CachingHint);
this->drawTextureProducer(&maker, src, &dst, constraint, *draw.fMatrix, fClip, paint);
} else if (as_IB(image)->getROPixels(&bm)) {
this->drawBitmapRect(draw, bm, src, dst, paint, constraint);
@@ -1428,7 +1428,7 @@
void SkGpuDevice::drawProducerNine(const SkDraw& draw, GrTextureProducer* producer,
const SkIRect& center, const SkRect& dst, const SkPaint& paint) {
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawProducerNine", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawProducerNine", fContext.get());
CHECK_SHOULD_DRAW(draw);
@@ -1481,7 +1481,7 @@
} else {
SkBitmap bm;
if (SkImageCacherator* cacher = as_IB(image)->peekCacherator()) {
- GrImageTextureMaker maker(fContext, cacher, image, SkImage::kAllow_CachingHint);
+ GrImageTextureMaker maker(fContext.get(), cacher, image, SkImage::kAllow_CachingHint);
this->drawProducerNine(draw, &maker, center, dst, paint);
} else if (as_IB(image)->getROPixels(&bm)) {
this->drawBitmapNine(draw, bm, center, dst, paint);
@@ -1492,14 +1492,14 @@
void SkGpuDevice::drawBitmapNine(const SkDraw& draw, const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint& paint) {
ASSERT_SINGLE_OWNER
- GrBitmapTextureMaker maker(fContext, bitmap);
+ GrBitmapTextureMaker maker(fContext.get(), bitmap);
this->drawProducerNine(draw, &maker, center, dst, paint);
}
void SkGpuDevice::drawProducerLattice(const SkDraw& draw, GrTextureProducer* producer,
const SkCanvas::Lattice& lattice, const SkRect& dst,
const SkPaint& paint) {
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawProducerLattice", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawProducerLattice", fContext.get());
CHECK_SHOULD_DRAW(draw);
@@ -1536,7 +1536,7 @@
} else {
SkBitmap bm;
if (SkImageCacherator* cacher = as_IB(image)->peekCacherator()) {
- GrImageTextureMaker maker(fContext, cacher, image, SkImage::kAllow_CachingHint);
+ GrImageTextureMaker maker(fContext.get(), cacher, image, SkImage::kAllow_CachingHint);
this->drawProducerLattice(draw, &maker, lattice, dst, paint);
} else if (as_IB(image)->getROPixels(&bm)) {
this->drawBitmapLattice(draw, bm, lattice, dst, paint);
@@ -1548,7 +1548,7 @@
const SkCanvas::Lattice& lattice, const SkRect& dst,
const SkPaint& paint) {
ASSERT_SINGLE_OWNER
- GrBitmapTextureMaker maker(fContext, bitmap);
+ GrBitmapTextureMaker maker(fContext.get(), bitmap);
this->drawProducerLattice(draw, &maker, lattice, dst, paint);
}
@@ -1569,7 +1569,7 @@
const SkPaint& paint) {
ASSERT_SINGLE_OWNER
CHECK_SHOULD_DRAW(draw);
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawVertices", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawVertices", fContext.get());
// If both textures and vertex-colors are nullptr, strokes hairlines with the paint's color.
if ((nullptr == texs || nullptr == paint.getShader()) && nullptr == colors) {
@@ -1697,7 +1697,7 @@
}
CHECK_SHOULD_DRAW(draw);
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawText", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawText", fContext.get());
SkPaint p(paint);
p.setShader(atlas->makeShader(SkShader::kClamp_TileMode, SkShader::kClamp_TileMode));
@@ -1726,7 +1726,7 @@
const SkPaint& paint) {
ASSERT_SINGLE_OWNER
CHECK_SHOULD_DRAW(draw);
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawText", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawText", fContext.get());
GrPaint grPaint;
if (!SkPaintToGrPaint(this->context(), fRenderTargetContext.get(), paint, *draw.fMatrix,
@@ -1744,7 +1744,7 @@
const SkScalar pos[], int scalarsPerPos,
const SkPoint& offset, const SkPaint& paint) {
ASSERT_SINGLE_OWNER
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPosText", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPosText", fContext.get());
CHECK_SHOULD_DRAW(draw);
GrPaint grPaint;
@@ -1763,7 +1763,7 @@
void SkGpuDevice::drawTextBlob(const SkDraw& draw, const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint, SkDrawFilter* drawFilter) {
ASSERT_SINGLE_OWNER
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawTextBlob", fContext);
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawTextBlob", fContext.get());
CHECK_SHOULD_DRAW(draw);
SkDEBUGCODE(this->validate();)
@@ -1820,7 +1820,7 @@
ASSERT_SINGLE_OWNER
// TODO: Change the signature of newSurface to take a budgeted parameter.
static const SkBudgeted kBudgeted = SkBudgeted::kNo;
- return SkSurface::MakeRenderTarget(fContext, kBudgeted, info,
+ return SkSurface::MakeRenderTarget(fContext.get(), kBudgeted, info,
fRenderTargetContext->desc().fSampleCnt,
fRenderTargetContext->origin(), &props);
}
diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h
index bed8d89..ca5be45 100644
--- a/src/gpu/SkGpuDevice.h
+++ b/src/gpu/SkGpuDevice.h
@@ -57,7 +57,7 @@
~SkGpuDevice() override {}
- GrContext* context() const override { return fContext; }
+ GrContext* context() const override { return fContext.get(); }
// set all pixels to 0
void clearAll();
@@ -132,13 +132,13 @@
private:
// We want these unreffed in RenderTargetContext, GrContext order.
- SkAutoTUnref<GrContext> fContext;
- sk_sp<GrRenderTargetContext> fRenderTargetContext;
+ sk_sp<GrContext> fContext;
+ sk_sp<GrRenderTargetContext> fRenderTargetContext;
- SkIPoint fClipOrigin;
- GrClipStackClip fClip;
- SkISize fSize;
- bool fOpaque;
+ SkIPoint fClipOrigin;
+ GrClipStackClip fClip;
+ SkISize fSize;
+ bool fOpaque;
enum Flags {
kNeedClear_Flag = 1 << 0, //!< Surface requires an initial clear
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp
index a057426..d50b050 100644
--- a/src/gpu/SkGpuDevice_drawTexture.cpp
+++ b/src/gpu/SkGpuDevice_drawTexture.cpp
@@ -209,8 +209,8 @@
}
GrPaint grPaint;
- if (!SkPaintToGrPaintWithTexture(fContext, fRenderTargetContext.get(), paint, viewMatrix, fp,
- producer->isAlphaOnly(), &grPaint)) {
+ if (!SkPaintToGrPaintWithTexture(fContext.get(), fRenderTargetContext.get(), paint, viewMatrix,
+ fp, producer->isAlphaOnly(), &grPaint)) {
return;
}
@@ -231,14 +231,14 @@
viewMatrix.mapRectScaleTranslate(&devClippedDstRect, clippedDstRect);
SkStrokeRec rec(SkStrokeRec::kFill_InitStyle);
- if (mf->directFilterRRectMaskGPU(fContext,
- fRenderTargetContext.get(),
- &grPaint,
- clip,
- viewMatrix,
- rec,
- SkRRect::MakeRect(clippedDstRect),
- SkRRect::MakeRect(devClippedDstRect))) {
+ if (mf->directFilterRRectMaskGPU(fContext.get(),
+ fRenderTargetContext.get(),
+ &grPaint,
+ clip,
+ viewMatrix,
+ rec,
+ SkRRect::MakeRect(clippedDstRect),
+ SkRRect::MakeRect(devClippedDstRect))) {
return;
}
}
diff --git a/src/gpu/batches/GrAAConvexPathRenderer.cpp b/src/gpu/batches/GrAAConvexPathRenderer.cpp
index c761e4e..4683aa1 100644
--- a/src/gpu/batches/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/batches/GrAAConvexPathRenderer.cpp
@@ -990,13 +990,13 @@
SkPath path;
args.fShape->asPath(&path);
- SkAutoTUnref<GrDrawBatch> batch(new AAConvexPathBatch(args.fPaint->getColor(),
+ sk_sp<GrDrawBatch> batch(new AAConvexPathBatch(args.fPaint->getColor(),
*args.fViewMatrix, path));
GrPipelineBuilder pipelineBuilder(*args.fPaint);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
- args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch);
+ args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch.get());
return true;
diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
index c009b8f..2572ab8 100644
--- a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
@@ -172,8 +172,8 @@
}
struct FlushInfo {
- SkAutoTUnref<const GrBuffer> fVertexBuffer;
- SkAutoTUnref<const GrBuffer> fIndexBuffer;
+ sk_sp<const GrBuffer> fVertexBuffer;
+ sk_sp<const GrBuffer> fIndexBuffer;
sk_sp<GrGeometryProcessor> fGeometryProcessor;
int fVertexOffset;
int fInstancesToFlush;
@@ -453,8 +453,8 @@
GrMesh mesh;
int maxInstancesPerDraw =
static_cast<int>(flushInfo->fIndexBuffer->gpuMemorySize() / sizeof(uint16_t) / 6);
- mesh.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuffer,
- flushInfo->fIndexBuffer, flushInfo->fVertexOffset, kVerticesPerQuad,
+ mesh.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuffer.get(),
+ flushInfo->fIndexBuffer.get(), flushInfo->fVertexOffset, kVerticesPerQuad,
kIndicesPerQuad, flushInfo->fInstancesToFlush, maxInstancesPerDraw);
target->draw(flushInfo->fGeometryProcessor.get(), mesh);
flushInfo->fVertexOffset += kVerticesPerQuad * flushInfo->fInstancesToFlush;
@@ -526,16 +526,16 @@
}
}
- SkAutoTUnref<GrDrawBatch> batch(new AADistanceFieldPathBatch(args.fPaint->getColor(),
- *args.fShape,
- args.fAntiAlias, *args.fViewMatrix,
- fAtlas, &fShapeCache, &fShapeList,
- args.fGammaCorrect));
+ sk_sp<GrDrawBatch> batch(new AADistanceFieldPathBatch(args.fPaint->getColor(),
+ *args.fShape,
+ args.fAntiAlias, *args.fViewMatrix,
+ fAtlas, &fShapeCache, &fShapeList,
+ args.fGammaCorrect));
GrPipelineBuilder pipelineBuilder(*args.fPaint);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
- args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch);
+ args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch.get());
return true;
}
diff --git a/src/gpu/batches/GrAAFillRectBatch.cpp b/src/gpu/batches/GrAAFillRectBatch.cpp
index 4f93adf..fd2a4c4 100644
--- a/src/gpu/batches/GrAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrAAFillRectBatch.cpp
@@ -235,10 +235,10 @@
size_t vertexStride = gp->getVertexStride();
- SkAutoTUnref<const GrBuffer> indexBuffer(get_index_buffer(target->resourceProvider()));
+ sk_sp<const GrBuffer> indexBuffer(get_index_buffer(target->resourceProvider()));
InstancedHelper helper;
void* vertices = helper.init(target, kTriangles_GrPrimitiveType, vertexStride,
- indexBuffer, kVertsPerAAFillRect,
+ indexBuffer.get(), kVertsPerAAFillRect,
kIndicesPerAAFillRect, fRectCnt);
if (!vertices || !indexBuffer) {
SkDebugf("Could not allocate vertices\n");
diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
index d026906..eb1be15 100644
--- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
@@ -844,7 +844,7 @@
*geometryProcessorViewM);
}
- SkAutoTUnref<const GrBuffer> linesIndexBuffer(
+ sk_sp<const GrBuffer> linesIndexBuffer(
ref_lines_index_buffer(target->resourceProvider()));
const GrBuffer* vertexBuffer;
@@ -867,7 +867,7 @@
}
GrMesh mesh;
- mesh.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, linesIndexBuffer,
+ mesh.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, linesIndexBuffer.get(),
firstVertex, kLineSegNumVertices, kIdxsPerLineSeg, lineCount,
kLineSegsNumInIdxBuffer);
target->draw(lineGP.get(), mesh);
@@ -895,7 +895,7 @@
const GrBuffer* vertexBuffer;
int firstVertex;
- SkAutoTUnref<const GrBuffer> quadsIndexBuffer(
+ sk_sp<const GrBuffer> quadsIndexBuffer(
ref_quads_index_buffer(target->resourceProvider()));
size_t vertexStride = sizeof(BezierVertex);
@@ -924,7 +924,7 @@
if (quadCount > 0) {
GrMesh mesh;
- mesh.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, quadsIndexBuffer,
+ mesh.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, quadsIndexBuffer.get(),
firstVertex, kQuadNumVertices, kIdxsPerQuad, quadCount,
kQuadsNumInIdxBuffer);
target->draw(quadGP.get(), mesh);
@@ -933,7 +933,7 @@
if (conicCount > 0) {
GrMesh mesh;
- mesh.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, quadsIndexBuffer,
+ mesh.initInstanced(kTriangles_GrPrimitiveType, vertexBuffer, quadsIndexBuffer.get(),
firstVertex, kQuadNumVertices, kIdxsPerQuad, conicCount,
kQuadsNumInIdxBuffer);
target->draw(conicGP.get(), mesh);
@@ -967,13 +967,13 @@
SkPath path;
args.fShape->asPath(&path);
- SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fPaint->getColor(),
- *args.fViewMatrix, path,
- args.fShape->style(), devClipBounds));
+ sk_sp<GrDrawBatch> batch(create_hairline_batch(args.fPaint->getColor(),
+ *args.fViewMatrix, path,
+ args.fShape->style(), devClipBounds));
GrPipelineBuilder pipelineBuilder(*args.fPaint);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
- args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch);
+ args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch.get());
return true;
}
diff --git a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
index 4d87038..d53fe9c 100644
--- a/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp
@@ -343,16 +343,16 @@
SkPaint::Join join = fill ? SkPaint::Join::kMiter_Join : stroke.getJoin();
SkScalar miterLimit = stroke.getMiter();
- SkAutoTUnref<GrDrawBatch> batch(new AAFlatteningConvexPathBatch(args.fPaint->getColor(),
- *args.fViewMatrix,
- path, strokeWidth,
- stroke.getStyle(),
- join, miterLimit));
+ sk_sp<GrDrawBatch> batch(new AAFlatteningConvexPathBatch(args.fPaint->getColor(),
+ *args.fViewMatrix,
+ path, strokeWidth,
+ stroke.getStyle(),
+ join, miterLimit));
GrPipelineBuilder pipelineBuilder(*args.fPaint);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
- args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch);
+ args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch.get());
return true;
}
diff --git a/src/gpu/batches/GrAAStrokeRectBatch.cpp b/src/gpu/batches/GrAAStrokeRectBatch.cpp
index bbee3f8..f3c512d 100644
--- a/src/gpu/batches/GrAAStrokeRectBatch.cpp
+++ b/src/gpu/batches/GrAAStrokeRectBatch.cpp
@@ -262,11 +262,11 @@
int indicesPerInstance = this->miterStroke() ? kMiterIndexCnt : kBevelIndexCnt;
int instanceCount = fGeoData.count();
- const SkAutoTUnref<const GrBuffer> indexBuffer(
+ const sk_sp<const GrBuffer> indexBuffer(
GetIndexBuffer(target->resourceProvider(), this->miterStroke()));
InstancedHelper helper;
void* vertices = helper.init(target, kTriangles_GrPrimitiveType, vertexStride,
- indexBuffer, verticesPerInstance, indicesPerInstance,
+ indexBuffer.get(), verticesPerInstance, indicesPerInstance,
instanceCount);
if (!vertices || !indexBuffer) {
SkDebugf("Could not allocate vertices\n");
diff --git a/src/gpu/batches/GrAnalyticRectBatch.cpp b/src/gpu/batches/GrAnalyticRectBatch.cpp
index 311c652..1ddcbdb 100644
--- a/src/gpu/batches/GrAnalyticRectBatch.cpp
+++ b/src/gpu/batches/GrAnalyticRectBatch.cpp
@@ -298,7 +298,7 @@
}
// Setup geometry processor
- SkAutoTUnref<GrGeometryProcessor> gp(new RectGeometryProcessor(localMatrix));
+ sk_sp<GrGeometryProcessor> gp(new RectGeometryProcessor(localMatrix));
int instanceCount = fGeoData.count();
size_t vertexStride = gp->getVertexStride();
@@ -353,7 +353,7 @@
verts += kVerticesPerQuad;
}
- helper.recordDraw(target, gp);
+ helper.recordDraw(target, gp.get());
}
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp
index 6427bc0..e9bb7f4 100644
--- a/src/gpu/batches/GrAtlasTextBatch.cpp
+++ b/src/gpu/batches/GrAtlasTextBatch.cpp
@@ -173,8 +173,8 @@
GrMesh mesh;
int maxGlyphsPerDraw =
static_cast<int>(flushInfo->fIndexBuffer->gpuMemorySize() / sizeof(uint16_t) / 6);
- mesh.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuffer,
- flushInfo->fIndexBuffer, flushInfo->fVertexOffset,
+ mesh.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuffer.get(),
+ flushInfo->fIndexBuffer.get(), flushInfo->fVertexOffset,
kVerticesPerGlyph, kIndicesPerGlyph, flushInfo->fGlyphsToFlush,
maxGlyphsPerDraw);
target->draw(flushInfo->fGeometryProcessor.get(), mesh);
diff --git a/src/gpu/batches/GrAtlasTextBatch.h b/src/gpu/batches/GrAtlasTextBatch.h
index 3277183..b3b88df 100644
--- a/src/gpu/batches/GrAtlasTextBatch.h
+++ b/src/gpu/batches/GrAtlasTextBatch.h
@@ -104,11 +104,11 @@
void initBatchTracker(const GrXPOverridesForBatch& overrides) override;
struct FlushInfo {
- SkAutoTUnref<const GrBuffer> fVertexBuffer;
- SkAutoTUnref<const GrBuffer> fIndexBuffer;
- sk_sp<GrGeometryProcessor> fGeometryProcessor;
- int fGlyphsToFlush;
- int fVertexOffset;
+ sk_sp<const GrBuffer> fVertexBuffer;
+ sk_sp<const GrBuffer> fIndexBuffer;
+ sk_sp<GrGeometryProcessor> fGeometryProcessor;
+ int fGlyphsToFlush;
+ int fVertexOffset;
};
void onPrepareDraws(Target* target) const override;
@@ -185,7 +185,7 @@
GrBatchFontCache* fFontCache;
// Distance field properties
- SkAutoTUnref<const GrDistanceFieldAdjustTable> fDistanceAdjustTable;
+ sk_sp<const GrDistanceFieldAdjustTable> fDistanceAdjustTable;
SkColor fFilteredColor;
bool fUseGammaCorrectDistanceTable;
diff --git a/src/gpu/batches/GrDashLinePathRenderer.cpp b/src/gpu/batches/GrDashLinePathRenderer.cpp
index ec4a51e..d1833d7 100644
--- a/src/gpu/batches/GrDashLinePathRenderer.cpp
+++ b/src/gpu/batches/GrDashLinePathRenderer.cpp
@@ -39,11 +39,11 @@
}
SkPoint pts[2];
SkAssertResult(args.fShape->asLine(pts, nullptr));
- SkAutoTUnref<GrDrawBatch> batch(GrDashingEffect::CreateDashLineBatch(args.fPaint->getColor(),
- *args.fViewMatrix,
- pts,
- aaMode,
- args.fShape->style()));
+ sk_sp<GrDrawBatch> batch(GrDashingEffect::CreateDashLineBatch(args.fPaint->getColor(),
+ *args.fViewMatrix,
+ pts,
+ aaMode,
+ args.fShape->style()));
if (!batch) {
return false;
}
@@ -51,6 +51,6 @@
GrPipelineBuilder pipelineBuilder(*args.fPaint, useHWAA);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
- args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch);
+ args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch.get());
return true;
}
diff --git a/src/gpu/batches/GrDashLinePathRenderer.h b/src/gpu/batches/GrDashLinePathRenderer.h
index db2f87f..482c1a0 100644
--- a/src/gpu/batches/GrDashLinePathRenderer.h
+++ b/src/gpu/batches/GrDashLinePathRenderer.h
@@ -22,7 +22,7 @@
bool onDrawPath(const DrawPathArgs&) override;
- SkAutoTUnref<GrGpu> fGpu;
+ sk_sp<GrGpu> fGpu;
typedef GrPathRenderer INHERITED;
};
diff --git a/src/gpu/batches/GrDefaultPathRenderer.cpp b/src/gpu/batches/GrDefaultPathRenderer.cpp
index 6c677e7..2fbc90b 100644
--- a/src/gpu/batches/GrDefaultPathRenderer.cpp
+++ b/src/gpu/batches/GrDefaultPathRenderer.cpp
@@ -552,7 +552,7 @@
}
const SkMatrix& viewM = (reverse && viewMatrix.hasPerspective()) ? SkMatrix::I() :
viewMatrix;
- SkAutoTUnref<GrDrawBatch> batch(
+ sk_sp<GrDrawBatch> batch(
GrRectBatchFactory::CreateNonAAFill(paint.getColor(), viewM, bounds, nullptr,
&localMatrix));
@@ -561,12 +561,12 @@
pipelineBuilder.setDrawFace(drawFace[p]);
pipelineBuilder.setUserStencil(passes[p]);
- renderTargetContext->drawBatch(pipelineBuilder, clip, batch);
+ renderTargetContext->drawBatch(pipelineBuilder, clip, batch.get());
} else {
- SkAutoTUnref<GrDrawBatch> batch(new DefaultPathBatch(paint.getColor(), path,
- srcSpaceTol,
- newCoverage, viewMatrix,
- isHairline, devBounds));
+ sk_sp<GrDrawBatch> batch(new DefaultPathBatch(paint.getColor(), path,
+ srcSpaceTol,
+ newCoverage, viewMatrix,
+ isHairline, devBounds));
GrPipelineBuilder pipelineBuilder(paint, renderTargetContext->mustUseHWAA(paint));
pipelineBuilder.setDrawFace(drawFace[p]);
@@ -575,7 +575,7 @@
pipelineBuilder.setDisableColorXPFactory();
}
- renderTargetContext->drawBatch(pipelineBuilder, clip, batch);
+ renderTargetContext->drawBatch(pipelineBuilder, clip, batch.get());
}
}
return true;
diff --git a/src/gpu/batches/GrDrawPathBatch.cpp b/src/gpu/batches/GrDrawPathBatch.cpp
index 4080d2f..6522fb5 100644
--- a/src/gpu/batches/GrDrawPathBatch.cpp
+++ b/src/gpu/batches/GrDrawPathBatch.cpp
@@ -29,9 +29,9 @@
void GrDrawPathBatch::onDraw(GrBatchFlushState* state, const SkRect& bounds) {
GrProgramDesc desc;
- SkAutoTUnref<GrPathProcessor> pathProc(GrPathProcessor::Create(this->color(),
- this->overrides(),
- this->viewMatrix()));
+ sk_sp<GrPathProcessor> pathProc(GrPathProcessor::Create(this->color(),
+ this->overrides(),
+ this->viewMatrix()));
state->gpu()->pathRendering()->drawPath(*this->pipeline(), *pathProc,
this->stencilPassSettings(), fPath.get());
}
@@ -127,10 +127,10 @@
localMatrix.setScale(fScale, fScale);
localMatrix.preTranslate(head.fX, head.fY);
- SkAutoTUnref<GrPathProcessor> pathProc(GrPathProcessor::Create(this->color(),
- this->overrides(),
- drawMatrix,
- localMatrix));
+ sk_sp<GrPathProcessor> pathProc(GrPathProcessor::Create(this->color(),
+ this->overrides(),
+ drawMatrix,
+ localMatrix));
if (fDraws.count() == 1) {
const InstanceData& instances = *head.fInstanceData;
diff --git a/src/gpu/batches/GrDrawPathBatch.h b/src/gpu/batches/GrDrawPathBatch.h
index 79b8b57..3a46f46 100644
--- a/src/gpu/batches/GrDrawPathBatch.h
+++ b/src/gpu/batches/GrDrawPathBatch.h
@@ -184,8 +184,8 @@
fY = y;
}
- SkAutoTUnref<const InstanceData> fInstanceData;
- SkScalar fX, fY;
+ sk_sp<const InstanceData> fInstanceData;
+ SkScalar fX, fY;
};
typedef GrPendingIOResource<const GrPathRange, kRead_GrIOType> PendingPathRange;
diff --git a/src/gpu/batches/GrMSAAPathRenderer.cpp b/src/gpu/batches/GrMSAAPathRenderer.cpp
index 8597082..0945c63 100644
--- a/src/gpu/batches/GrMSAAPathRenderer.cpp
+++ b/src/gpu/batches/GrMSAAPathRenderer.cpp
@@ -408,7 +408,7 @@
}
if (quadVertexOffset) {
- SkAutoTUnref<const GrGeometryProcessor> quadGP(MSAAQuadProcessor::Create(fViewMatrix));
+ sk_sp<const GrGeometryProcessor> quadGP(MSAAQuadProcessor::Create(fViewMatrix));
SkASSERT(quadVertexStride == quadGP->getVertexStride());
const GrBuffer* quadVertexBuffer;
@@ -432,7 +432,7 @@
quadMeshes.init(kTriangles_GrPrimitiveType, quadVertexBuffer, firstQuadVertex,
quadVertexOffset);
}
- target->draw(quadGP, quadMeshes);
+ target->draw(quadGP.get(), quadMeshes);
}
}
@@ -647,17 +647,17 @@
}
const SkMatrix& viewM = (reverse && viewMatrix.hasPerspective()) ? SkMatrix::I() :
viewMatrix;
- SkAutoTUnref<GrDrawBatch> batch(
+ sk_sp<GrDrawBatch> batch(
GrRectBatchFactory::CreateNonAAFill(paint.getColor(), viewM, bounds, nullptr,
&localMatrix));
GrPipelineBuilder pipelineBuilder(paint, renderTargetContext->mustUseHWAA(paint));
pipelineBuilder.setUserStencil(passes[p]);
- renderTargetContext->drawBatch(pipelineBuilder, clip, batch);
+ renderTargetContext->drawBatch(pipelineBuilder, clip, batch.get());
} else {
- SkAutoTUnref<MSAAPathBatch> batch(new MSAAPathBatch(paint.getColor(), path,
- viewMatrix, devBounds));
+ sk_sp<MSAAPathBatch> batch(new MSAAPathBatch(paint.getColor(), path,
+ viewMatrix, devBounds));
if (!batch->isValid()) {
return false;
}
@@ -668,7 +668,7 @@
pipelineBuilder.setDisableColorXPFactory();
}
- renderTargetContext->drawBatch(pipelineBuilder, clip, batch);
+ renderTargetContext->drawBatch(pipelineBuilder, clip, batch.get());
}
}
return true;
diff --git a/src/gpu/batches/GrNinePatch.cpp b/src/gpu/batches/GrNinePatch.cpp
index 522e775..5e0be73 100644
--- a/src/gpu/batches/GrNinePatch.cpp
+++ b/src/gpu/batches/GrNinePatch.cpp
@@ -85,11 +85,10 @@
numRects += fPatches[i].fIter->numRectsToDraw();
}
- SkAutoTUnref<const GrBuffer> indexBuffer(
- target->resourceProvider()->refQuadIndexBuffer());
+ sk_sp<const GrBuffer> indexBuffer(target->resourceProvider()->refQuadIndexBuffer());
InstancedHelper helper;
void* vertices = helper.init(target, kTriangles_GrPrimitiveType, vertexStride,
- indexBuffer, kVertsPerRect,
+ indexBuffer.get(), kVertsPerRect,
kIndicesPerRect, numRects);
if (!vertices || !indexBuffer) {
SkDebugf("Could not allocate vertices\n");
diff --git a/src/gpu/batches/GrNonAAFillRectBatch.cpp b/src/gpu/batches/GrNonAAFillRectBatch.cpp
index 1422951..cc89d03 100644
--- a/src/gpu/batches/GrNonAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrNonAAFillRectBatch.cpp
@@ -139,10 +139,10 @@
size_t vertexStride = gp->getVertexStride();
int instanceCount = fRects.count();
- SkAutoTUnref<const GrBuffer> indexBuffer(target->resourceProvider()->refQuadIndexBuffer());
+ sk_sp<const GrBuffer> indexBuffer(target->resourceProvider()->refQuadIndexBuffer());
InstancedHelper helper;
void* vertices = helper.init(target, kTriangles_GrPrimitiveType, vertexStride,
- indexBuffer, kVertsPerInstance,
+ indexBuffer.get(), kVertsPerInstance,
kIndicesPerInstance, instanceCount);
if (!vertices || !indexBuffer) {
SkDebugf("Could not allocate vertices\n");
diff --git a/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp b/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp
index aa5a420..0652580 100644
--- a/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp
+++ b/src/gpu/batches/GrNonAAFillRectPerspectiveBatch.cpp
@@ -162,10 +162,10 @@
size_t vertexStride = gp->getVertexStride();
int instanceCount = fRects.count();
- SkAutoTUnref<const GrBuffer> indexBuffer(target->resourceProvider()->refQuadIndexBuffer());
+ sk_sp<const GrBuffer> indexBuffer(target->resourceProvider()->refQuadIndexBuffer());
InstancedHelper helper;
void* vertices = helper.init(target, kTriangles_GrPrimitiveType, vertexStride,
- indexBuffer, kVertsPerInstance,
+ indexBuffer.get(), kVertsPerInstance,
kIndicesPerInstance, instanceCount);
if (!vertices || !indexBuffer) {
SkDebugf("Could not allocate vertices\n");
diff --git a/src/gpu/batches/GrPLSPathRenderer.cpp b/src/gpu/batches/GrPLSPathRenderer.cpp
index 1c98f6a..e73f7f5 100644
--- a/src/gpu/batches/GrPLSPathRenderer.cpp
+++ b/src/gpu/batches/GrPLSPathRenderer.cpp
@@ -807,9 +807,9 @@
}
// Setup GrGeometryProcessors
- SkAutoTUnref<GrPLSGeometryProcessor> triangleProcessor(
+ sk_sp<GrPLSGeometryProcessor> triangleProcessor(
PLSAATriangleEffect::Create(invert, fUsesLocalCoords));
- SkAutoTUnref<GrPLSGeometryProcessor> quadProcessor(
+ sk_sp<GrPLSGeometryProcessor> quadProcessor(
PLSQuadEdgeEffect::Create(invert, fUsesLocalCoords));
GrResourceProvider* rp = target->resourceProvider();
@@ -857,7 +857,7 @@
}
mesh.init(kTriangles_GrPrimitiveType, triVertexBuffer, firstTriVertex,
triVertices.count());
- target->draw(triangleProcessor, mesh);
+ target->draw(triangleProcessor.get(), mesh);
}
if (quadVertices.count()) {
@@ -875,10 +875,10 @@
}
mesh.init(kTriangles_GrPrimitiveType, quadVertexBuffer, firstQuadVertex,
quadVertices.count());
- target->draw(quadProcessor, mesh);
+ target->draw(quadProcessor.get(), mesh);
}
- SkAutoTUnref<GrGeometryProcessor> finishProcessor(
+ sk_sp<GrGeometryProcessor> finishProcessor(
PLSFinishEffect::Create(fColor,
pathPtr->getFillType() ==
SkPath::FillType::kEvenOdd_FillType,
@@ -903,7 +903,7 @@
mesh.init(kTriangles_GrPrimitiveType, rectVertexBuffer, firstRectVertex,
kRectVertexCount);
- target->draw(finishProcessor, mesh);
+ target->draw(finishProcessor.get(), mesh);
}
private:
@@ -927,14 +927,14 @@
SkPath path;
args.fShape->asPath(&path);
- SkAutoTUnref<GrDrawBatch> batch(new PLSPathBatch(args.fPaint->getColor(),
- path, *args.fViewMatrix));
+ sk_sp<GrDrawBatch> batch(new PLSPathBatch(args.fPaint->getColor(),
+ path, *args.fViewMatrix));
GrPipelineBuilder pipelineBuilder(*args.fPaint,
args.fRenderTargetContext->mustUseHWAA(*args.fPaint));
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
- args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch);
+ args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch.get());
SkDEBUGCODE(inPLSDraw = false;)
return true;
diff --git a/src/gpu/batches/GrRegionBatch.cpp b/src/gpu/batches/GrRegionBatch.cpp
index 058baf0..47b6f67 100644
--- a/src/gpu/batches/GrRegionBatch.cpp
+++ b/src/gpu/batches/GrRegionBatch.cpp
@@ -110,10 +110,11 @@
}
size_t vertexStride = gp->getVertexStride();
- SkAutoTUnref<const GrBuffer> indexBuffer(target->resourceProvider()->refQuadIndexBuffer());
+ sk_sp<const GrBuffer> indexBuffer(target->resourceProvider()->refQuadIndexBuffer());
InstancedHelper helper;
void* vertices = helper.init(target, kTriangles_GrPrimitiveType, vertexStride,
- indexBuffer, kVertsPerInstance, kIndicesPerInstance, numRects);
+ indexBuffer.get(), kVertsPerInstance, kIndicesPerInstance,
+ numRects);
if (!vertices || !indexBuffer) {
SkDebugf("Could not allocate vertices\n");
return;
diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
index b6bf940..d660ab9 100644
--- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
@@ -82,8 +82,9 @@
"GrStencilAndCoverPathRenderer::onStencilPath");
SkASSERT(!args.fIsAA || args.fRenderTargetContext->isStencilBufferMultisampled());
- SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, *args.fShape));
- args.fRenderTargetContext->priv().stencilPath(*args.fClip, args.fIsAA, *args.fViewMatrix, p);
+ sk_sp<GrPath> p(get_gr_path(fResourceProvider, *args.fShape));
+ args.fRenderTargetContext->priv().stencilPath(*args.fClip, args.fIsAA,
+ *args.fViewMatrix, p.get());
}
bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
@@ -96,7 +97,7 @@
const SkMatrix& viewMatrix = *args.fViewMatrix;
- SkAutoTUnref<GrPath> path(get_gr_path(fResourceProvider, *args.fShape));
+ sk_sp<GrPath> path(get_gr_path(fResourceProvider, *args.fShape));
if (args.fShape->inverseFilled()) {
SkMatrix invert = SkMatrix::I();
@@ -119,13 +120,13 @@
}
const SkMatrix& viewM = viewMatrix.hasPerspective() ? SkMatrix::I() : viewMatrix;
- SkAutoTUnref<GrDrawBatch> coverBatch(
+ sk_sp<GrDrawBatch> coverBatch(
GrRectBatchFactory::CreateNonAAFill(args.fPaint->getColor(), viewM, bounds,
nullptr, &invert));
// fake inverse with a stencil and cover
args.fRenderTargetContext->priv().stencilPath(*args.fClip, args.fPaint->isAntiAlias(),
- viewMatrix, path);
+ viewMatrix, path.get());
{
static constexpr GrUserStencilSettings kInvertedCoverPass(
@@ -146,7 +147,7 @@
!args.fRenderTargetContext->hasMixedSamples());
pipelineBuilder.setUserStencil(&kInvertedCoverPass);
- args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, coverBatch);
+ args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, coverBatch.get());
}
} else {
static constexpr GrUserStencilSettings kCoverPass(
@@ -159,8 +160,8 @@
0xffff>()
);
- SkAutoTUnref<GrDrawBatch> batch(GrDrawPathBatch::Create(viewMatrix, args.fPaint->getColor(),
- path));
+ sk_sp<GrDrawBatch> batch(GrDrawPathBatch::Create(viewMatrix, args.fPaint->getColor(),
+ path.get()));
GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fPaint->isAntiAlias());
pipelineBuilder.setUserStencil(&kCoverPass);
@@ -169,7 +170,7 @@
pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag);
}
- args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch);
+ args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch.get());
}
return true;
diff --git a/src/gpu/batches/GrTessellatingPathRenderer.cpp b/src/gpu/batches/GrTessellatingPathRenderer.cpp
index b50cdb0..5260368 100644
--- a/src/gpu/batches/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/batches/GrTessellatingPathRenderer.cpp
@@ -95,7 +95,7 @@
}
GrBuffer* vertexBuffer() { return fVertexBuffer.get(); }
private:
- SkAutoTUnref<GrBuffer> fVertexBuffer;
+ sk_sp<GrBuffer> fVertexBuffer;
GrResourceProvider* fResourceProvider;
bool fCanMapVB;
void* fVertices;
@@ -217,7 +217,7 @@
memset(&builder[shapeKeyDataCnt], 0, sizeof(fDevClipBounds));
}
builder.finish();
- SkAutoTUnref<GrBuffer> cachedVertexBuffer(rp->findAndRefTByUniqueKey<GrBuffer>(key));
+ sk_sp<GrBuffer> cachedVertexBuffer(rp->findAndRefTByUniqueKey<GrBuffer>(key));
int actualCount;
SkScalar tol = GrPathUtils::kDefaultTolerance;
tol = GrPathUtils::scaleToleranceToSrc(tol, fViewMatrix, fShape.bounds());
@@ -356,17 +356,17 @@
args.fClip->getConservativeBounds(args.fRenderTargetContext->width(),
args.fRenderTargetContext->height(),
&clipBoundsI);
- SkAutoTUnref<GrDrawBatch> batch(TessellatingPathBatch::Create(args.fPaint->getColor(),
- *args.fShape,
- *args.fViewMatrix,
- clipBoundsI,
- args.fAntiAlias));
+ sk_sp<GrDrawBatch> batch(TessellatingPathBatch::Create(args.fPaint->getColor(),
+ *args.fShape,
+ *args.fViewMatrix,
+ clipBoundsI,
+ args.fAntiAlias));
GrPipelineBuilder pipelineBuilder(*args.fPaint,
args.fRenderTargetContext->mustUseHWAA(*args.fPaint));
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
- args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch);
+ args.fRenderTargetContext->drawBatch(pipelineBuilder, *args.fClip, batch.get());
return true;
}
diff --git a/src/gpu/batches/GrVertexBatch.cpp b/src/gpu/batches/GrVertexBatch.cpp
index 2286342..14403bf 100644
--- a/src/gpu/batches/GrVertexBatch.cpp
+++ b/src/gpu/batches/GrVertexBatch.cpp
@@ -52,14 +52,15 @@
void* GrVertexBatch::QuadHelper::init(Target* target, size_t vertexStride,
int quadsToDraw) {
- SkAutoTUnref<const GrBuffer> quadIndexBuffer(
+ sk_sp<const GrBuffer> quadIndexBuffer(
target->resourceProvider()->refQuadIndexBuffer());
if (!quadIndexBuffer) {
SkDebugf("Could not get quad index buffer.");
return nullptr;
}
return this->INHERITED::init(target, kTriangles_GrPrimitiveType, vertexStride,
- quadIndexBuffer, kVerticesPerQuad, kIndicesPerQuad, quadsToDraw);
+ quadIndexBuffer.get(), kVerticesPerQuad, kIndicesPerQuad,
+ quadsToDraw);
}
void GrVertexBatch::onDraw(GrBatchFlushState* state, const SkRect& bounds) {
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 8a11249..db70017 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -197,7 +197,7 @@
desc.fWidth = kSize;
desc.fHeight = kSize;
desc.fConfig = kConfig;
- SkAutoTUnref<GrTexture> dataTex(context->textureProvider()->createTexture(
+ sk_sp<GrTexture> dataTex(context->textureProvider()->createTexture(
desc, SkBudgeted::kYes, data, 0));
if (!dataTex.get()) {
return;
@@ -224,7 +224,7 @@
GrPaint paint2;
GrPaint paint3;
sk_sp<GrFragmentProcessor> pmToUPM1(new GrConfigConversionEffect(
- dataTex, GrSwizzle::RGBA(), *pmToUPMRule, SkMatrix::I()));
+ dataTex.get(), GrSwizzle::RGBA(), *pmToUPMRule, SkMatrix::I()));
sk_sp<GrFragmentProcessor> upmToPM(new GrConfigConversionEffect(
readRTC->asTexture().get(), GrSwizzle::RGBA(), *upmToPMRule, SkMatrix::I()));
sk_sp<GrFragmentProcessor> pmToUPM2(new GrConfigConversionEffect(
diff --git a/src/gpu/gl/GrGLBuffer.cpp b/src/gpu/gl/GrGLBuffer.cpp
index 96226b9..250c711 100644
--- a/src/gpu/gl/GrGLBuffer.cpp
+++ b/src/gpu/gl/GrGLBuffer.cpp
@@ -30,7 +30,7 @@
GrGLBuffer* GrGLBuffer::Create(GrGLGpu* gpu, size_t size, GrBufferType intendedType,
GrAccessPattern accessPattern, const void* data) {
- SkAutoTUnref<GrGLBuffer> buffer(new GrGLBuffer(gpu, size, intendedType, accessPattern, data));
+ sk_sp<GrGLBuffer> buffer(new GrGLBuffer(gpu, size, intendedType, accessPattern, data));
if (0 == buffer->bufferID()) {
return nullptr;
}
diff --git a/src/gpu/gl/GrGLContext.cpp b/src/gpu/gl/GrGLContext.cpp
index 2126314..5adba5a 100644
--- a/src/gpu/gl/GrGLContext.cpp
+++ b/src/gpu/gl/GrGLContext.cpp
@@ -84,5 +84,5 @@
fDriver = args.fDriver;
fDriverVersion = args.fDriverVersion;
- fGLCaps.reset(new GrGLCaps(*args.fContextOptions, *this, fInterface));
+ fGLCaps = sk_make_sp<GrGLCaps>(*args.fContextOptions, *this, fInterface.get());
}
diff --git a/src/gpu/gl/GrGLContext.h b/src/gpu/gl/GrGLContext.h
index 8207ac8..0bf045a 100644
--- a/src/gpu/gl/GrGLContext.h
+++ b/src/gpu/gl/GrGLContext.h
@@ -35,7 +35,7 @@
GrGLDriver driver() const { return fDriver; }
GrGLDriverVersion driverVersion() const { return fDriverVersion; }
const GrGLCaps* caps() const { return fGLCaps.get(); }
- GrGLCaps* caps() { return fGLCaps; }
+ GrGLCaps* caps() { return fGLCaps.get(); }
bool hasExtension(const char* ext) const {
return fInterface->hasExtension(ext);
}
@@ -58,14 +58,14 @@
GrGLContextInfo(const ConstructorArgs& args);
- SkAutoTUnref<const GrGLInterface> fInterface;
- GrGLVersion fGLVersion;
- GrGLSLGeneration fGLSLGeneration;
- GrGLVendor fVendor;
- GrGLRenderer fRenderer;
- GrGLDriver fDriver;
- GrGLDriverVersion fDriverVersion;
- SkAutoTUnref<GrGLCaps> fGLCaps;
+ sk_sp<const GrGLInterface> fInterface;
+ GrGLVersion fGLVersion;
+ GrGLSLGeneration fGLSLGeneration;
+ GrGLVendor fVendor;
+ GrGLRenderer fRenderer;
+ GrGLDriver fDriver;
+ GrGLDriverVersion fDriverVersion;
+ sk_sp<GrGLCaps> fGLCaps;
};
/**
@@ -79,7 +79,7 @@
*/
static GrGLContext* Create(const GrGLInterface* interface, const GrContextOptions& options);
- const GrGLInterface* interface() const { return fInterface; }
+ const GrGLInterface* interface() const { return fInterface.get(); }
SkSL::Compiler* compiler() const;
diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp
index 61f638b..b41f826 100644
--- a/src/gpu/gl/GrGLCreateNullInterface.cpp
+++ b/src/gpu/gl/GrGLCreateNullInterface.cpp
@@ -176,7 +176,7 @@
void notifyAttachmentDeleteWhileBound(const FramebufferAttachment* deleted) {
for (auto& attachment : fAttachments) {
- if (attachment == deleted) {
+ if (attachment.get() == deleted) {
attachment.reset(nullptr);
}
}
@@ -206,7 +206,7 @@
};
constexpr int static kNumAttachmentPoints = 1 + (int)AttachmentPoint::kColor;
- SkAutoTUnref<const FramebufferAttachment> fAttachments[kNumAttachmentPoints];
+ sk_sp<const FramebufferAttachment> fAttachments[kNumAttachmentPoints];
typedef GLObject INHERITED;
};
@@ -710,7 +710,7 @@
GrGLuint fCurrGenericID;
GrGLuint fCurrUniformLocation;
GrGLuint fCurrPathID;
- SkAutoTUnref<const Texture> fSingleTextureObject;
+ sk_sp<const Texture> fSingleTextureObject;
SkTArray<const char*> fExtensions;
// the OpenGLES 2.0 spec says this must be >= 128
@@ -746,7 +746,7 @@
if (!fSingleTextureObject) {
fSingleTextureObject.reset(new Texture);
}
- return fSingleTextureObject;
+ return fSingleTextureObject.get();
}
const GrGLubyte* CombinedExtensionString() {
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 9af3acc..838ad58 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -173,7 +173,7 @@
GrGpu* GrGLGpu::Create(GrBackendContext backendContext, const GrContextOptions& options,
GrContext* context) {
- SkAutoTUnref<const GrGLInterface> glInterface(
+ sk_sp<const GrGLInterface> glInterface(
reinterpret_cast<const GrGLInterface*>(backendContext));
if (!glInterface) {
glInterface.reset(GrGLDefaultInterface());
@@ -183,7 +183,7 @@
if (!glInterface) {
return nullptr;
}
- GrGLContext* glContext = GrGLContext::Create(glInterface, options);
+ GrGLContext* glContext = GrGLContext::Create(glInterface.get(), options);
if (glContext) {
return new GrGLGpu(glContext, context);
}
@@ -2022,8 +2022,7 @@
bool GrGLGpu::flushGLState(const GrPipeline& pipeline, const GrPrimitiveProcessor& primProc,
bool willDrawPoints) {
- SkAutoTUnref<GrGLProgram> program(fProgramCache->refProgram(this, pipeline, primProc,
- willDrawPoints));
+ sk_sp<GrGLProgram> program(fProgramCache->refProgram(this, pipeline, primProc, willDrawPoints));
if (!program) {
GrCapsDebugf(this->caps(), "Failed to create program!\n");
return false;
@@ -2307,8 +2306,7 @@
desc.fConfig = rtConfig;
desc.fWidth = desc.fHeight = 16;
desc.fFlags = kRenderTarget_GrSurfaceFlag;
- SkAutoTUnref<GrTexture> temp(this->createTexture(desc,
- SkBudgeted::kNo));
+ sk_sp<GrTexture> temp(this->createTexture(desc, SkBudgeted::kNo));
if (!temp) {
return false;
}
@@ -2828,7 +2826,7 @@
this->fHWVertexArrayState.setVertexArrayID(this, 0);
GrGLAttribArrayState* attribs = this->fHWVertexArrayState.bindInternalVertexArray(this);
- attribs->set(this, 0, fPLSSetupProgram.fArrayBuffer, kVec2f_GrVertexAttribType,
+ attribs->set(this, 0, fPLSSetupProgram.fArrayBuffer.get(), kVec2f_GrVertexAttribType,
2 * sizeof(GrGLfloat), 0);
attribs->disableUnusedArrays(this, 0x1);
@@ -4125,8 +4123,8 @@
fHWVertexArrayState.setVertexArrayID(this, 0);
GrGLAttribArrayState* attribs = fHWVertexArrayState.bindInternalVertexArray(this);
- attribs->set(this, 0, fWireRectArrayBuffer, kVec2f_GrVertexAttribType, 2 * sizeof(GrGLfloat),
- 0);
+ attribs->set(this, 0, fWireRectArrayBuffer.get(), kVec2f_GrVertexAttribType,
+ 2 * sizeof(GrGLfloat), 0);
attribs->disableUnusedArrays(this, 0x1);
GL_CALL(Uniform4fv(fWireRectProgram.fRectUniform, 1, edges));
@@ -4179,8 +4177,8 @@
fHWVertexArrayState.setVertexArrayID(this, 0);
GrGLAttribArrayState* attribs = fHWVertexArrayState.bindInternalVertexArray(this);
- attribs->set(this, 0, fCopyProgramArrayBuffer, kVec2f_GrVertexAttribType, 2 * sizeof(GrGLfloat),
- 0);
+ attribs->set(this, 0, fCopyProgramArrayBuffer.get(), kVec2f_GrVertexAttribType,
+ 2 * sizeof(GrGLfloat), 0);
attribs->disableUnusedArrays(this, 0x1);
// dst rect edges in NDC (-1 to 1)
@@ -4422,7 +4420,7 @@
fHWVertexArrayState.setVertexArrayID(this, 0);
GrGLAttribArrayState* attribs = fHWVertexArrayState.bindInternalVertexArray(this);
- attribs->set(this, 0, fMipmapProgramArrayBuffer, kVec2f_GrVertexAttribType,
+ attribs->set(this, 0, fMipmapProgramArrayBuffer.get(), kVec2f_GrVertexAttribType,
2 * sizeof(GrGLfloat), 0);
attribs->disableUnusedArrays(this, 0x1);
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 1b87118..32ce979 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -393,7 +393,7 @@
// Must be called if bindSurfaceFBOForPixelOps was used to bind a surface for copying.
void unbindTextureFBOForPixelOps(GrGLenum fboTarget, GrSurface* surface);
- SkAutoTUnref<GrGLContext> fGLContext;
+ sk_sp<GrGLContext> fGLContext;
bool createCopyProgram(int progIdx);
bool createMipmapProgram(int progIdx);
@@ -596,7 +596,7 @@
GrGLint fTexCoordXformUniform;
GrGLint fPosXformUniform;
} fCopyPrograms[3];
- SkAutoTUnref<GrGLBuffer> fCopyProgramArrayBuffer;
+ sk_sp<GrGLBuffer> fCopyProgramArrayBuffer;
/** IDs for texture mipmap program. (4 filter configurations) */
struct {
@@ -604,14 +604,14 @@
GrGLint fTextureUniform;
GrGLint fTexCoordXformUniform;
} fMipmapPrograms[4];
- SkAutoTUnref<GrGLBuffer> fMipmapProgramArrayBuffer;
+ sk_sp<GrGLBuffer> fMipmapProgramArrayBuffer;
struct {
GrGLuint fProgram;
GrGLint fColorUniform;
GrGLint fRectUniform;
} fWireRectProgram;
- SkAutoTUnref<GrGLBuffer> fWireRectArrayBuffer;
+ sk_sp<GrGLBuffer> fWireRectArrayBuffer;
static int TextureTargetToCopyProgramIdx(GrGLenum target) {
switch (target) {
@@ -636,7 +636,7 @@
struct {
GrGLuint fProgram;
GrGLint fPosXformUniform;
- SkAutoTUnref<GrGLBuffer> fArrayBuffer;
+ sk_sp<GrGLBuffer> fArrayBuffer;
} fPLSSetupProgram;
bool fHWPLSEnabled;
diff --git a/src/gpu/gl/GrGLGpuProgramCache.cpp b/src/gpu/gl/GrGLGpuProgramCache.cpp
index 260e256..9bca80c 100644
--- a/src/gpu/gl/GrGLGpuProgramCache.cpp
+++ b/src/gpu/gl/GrGLGpuProgramCache.cpp
@@ -26,8 +26,8 @@
Entry() : fProgram(nullptr), fLRUStamp(0) {}
- SkAutoTUnref<GrGLProgram> fProgram;
- unsigned int fLRUStamp;
+ sk_sp<GrGLProgram> fProgram;
+ unsigned int fLRUStamp;
};
struct GrGLGpu::ProgramCache::ProgDescLess {
diff --git a/src/gpu/instanced/GLInstancedRendering.h b/src/gpu/instanced/GLInstancedRendering.h
index ce1638c..9ac2bfe 100644
--- a/src/gpu/instanced/GLInstancedRendering.h
+++ b/src/gpu/instanced/GLInstancedRendering.h
@@ -48,8 +48,8 @@
};
GrGLuint fVertexArrayID;
- SkAutoTUnref<GrBuffer> fInstanceBuffer;
- SkAutoTUnref<GrBuffer> fDrawIndirectBuffer;
+ sk_sp<GrBuffer> fInstanceBuffer;
+ sk_sp<GrBuffer> fDrawIndirectBuffer;
SkAutoSTMalloc<1024, GLDrawCmdInfo> fGLDrawCmdsInfo;
uint32_t fInstanceAttribsBufferUniqueId;
int fInstanceAttribsBaseInstance;
diff --git a/src/gpu/instanced/InstancedRendering.cpp b/src/gpu/instanced/InstancedRendering.cpp
index 5564c63..30ec5ce 100644
--- a/src/gpu/instanced/InstancedRendering.cpp
+++ b/src/gpu/instanced/InstancedRendering.cpp
@@ -435,14 +435,14 @@
}
if (!fVertexBuffer) {
- fVertexBuffer.reset(InstanceProcessor::FindOrCreateVertexBuffer(fGpu));
+ fVertexBuffer.reset(InstanceProcessor::FindOrCreateVertexBuffer(fGpu.get()));
if (!fVertexBuffer) {
return;
}
}
if (!fIndexBuffer) {
- fIndexBuffer.reset(InstanceProcessor::FindOrCreateIndex8Buffer(fGpu));
+ fIndexBuffer.reset(InstanceProcessor::FindOrCreateIndex8Buffer(fGpu.get()));
if (!fIndexBuffer) {
return;
}
@@ -471,7 +471,7 @@
state->gpu()->xferBarrier(this->pipeline()->getRenderTarget(), barrierType);
}
- InstanceProcessor instProc(fInfo, fInstancedRendering->fParamsBuffer);
+ InstanceProcessor instProc(fInfo, fInstancedRendering->fParamsBuffer.get());
fInstancedRendering->onDraw(*this->pipeline(), instProc, this);
}
diff --git a/src/gpu/instanced/InstancedRendering.h b/src/gpu/instanced/InstancedRendering.h
index b71ca80..1325370 100644
--- a/src/gpu/instanced/InstancedRendering.h
+++ b/src/gpu/instanced/InstancedRendering.h
@@ -36,7 +36,7 @@
public:
virtual ~InstancedRendering() { SkASSERT(State::kRecordingDraws == fState); }
- GrGpu* gpu() const { return fGpu; }
+ GrGpu* gpu() const { return fGpu.get(); }
/**
* These methods make a new record internally for an instanced draw, and return a batch that is
@@ -147,8 +147,8 @@
InstancedRendering(GrGpu* gpu);
const BatchList& trackedBatches() const { return fTrackedBatches; }
- const GrBuffer* vertexBuffer() const { SkASSERT(fVertexBuffer); return fVertexBuffer; }
- const GrBuffer* indexBuffer() const { SkASSERT(fIndexBuffer); return fIndexBuffer; }
+ const GrBuffer* vertexBuffer() const { SkASSERT(fVertexBuffer); return fVertexBuffer.get(); }
+ const GrBuffer* indexBuffer() const { SkASSERT(fIndexBuffer); return fIndexBuffer.get(); }
virtual void onBeginFlush(GrResourceProvider*) = 0;
virtual void onDraw(const GrPipeline&, const InstanceProcessor&, const Batch*) = 0;
@@ -171,14 +171,14 @@
virtual Batch* createBatch() = 0;
- const SkAutoTUnref<GrGpu> fGpu;
+ const sk_sp<GrGpu> fGpu;
State fState;
GrMemoryPool fDrawPool;
SkSTArray<1024, ParamsTexel, true> fParams;
BatchList fTrackedBatches;
- SkAutoTUnref<const GrBuffer> fVertexBuffer;
- SkAutoTUnref<const GrBuffer> fIndexBuffer;
- SkAutoTUnref<GrBuffer> fParamsBuffer;
+ sk_sp<const GrBuffer> fVertexBuffer;
+ sk_sp<const GrBuffer> fIndexBuffer;
+ sk_sp<GrBuffer> fParamsBuffer;
};
}
diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp
index a28f638..9c6fdf3 100644
--- a/src/gpu/text/GrAtlasTextBlob.cpp
+++ b/src/gpu/text/GrAtlasTextBlob.cpp
@@ -65,7 +65,7 @@
run->fPathEffect = sk_ref_sp(effects.fPathEffect);
run->fRasterizer = sk_ref_sp(effects.fRasterizer);
run->fMaskFilter = sk_ref_sp(effects.fMaskFilter);
- return SkGlyphCache::DetachCache(run->fTypeface, effects, desc->getDesc());
+ return SkGlyphCache::DetachCache(run->fTypeface.get(), effects, desc->getDesc());
}
void GrAtlasTextBlob::appendGlyph(int runIndex,
@@ -318,16 +318,16 @@
GrColor color = grPaint.getColor();
- SkAutoTUnref<GrDrawBatch> batch(this->createBatch(info, glyphCount, run,
- subRun, viewMatrix, x, y, color,
- skPaint, props,
- distanceAdjustTable,
- rtc->isGammaCorrect(),
- cache));
+ sk_sp<GrDrawBatch> batch(this->createBatch(info, glyphCount, run,
+ subRun, viewMatrix, x, y, color,
+ skPaint, props,
+ distanceAdjustTable,
+ rtc->isGammaCorrect(),
+ cache));
GrPipelineBuilder pipelineBuilder(grPaint, rtc->mustUseHWAA(grPaint));
- rtc->drawBatch(pipelineBuilder, clip, batch);
+ rtc->drawBatch(pipelineBuilder, clip, batch.get());
}
}
@@ -506,7 +506,7 @@
if (lRun.fTypeface.get()) {
SkASSERT_RELEASE(rRun.fTypeface.get());
- SkASSERT_RELEASE(SkTypeface::Equal(lRun.fTypeface, rRun.fTypeface));
+ SkASSERT_RELEASE(SkTypeface::Equal(lRun.fTypeface.get(), rRun.fTypeface.get()));
} else {
SkASSERT_RELEASE(!rRun.fTypeface.get());
}
diff --git a/src/gpu/text/GrAtlasTextBlob.h b/src/gpu/text/GrAtlasTextBlob.h
index c8e2008..f24147f 100644
--- a/src/gpu/text/GrAtlasTextBlob.h
+++ b/src/gpu/text/GrAtlasTextBlob.h
@@ -452,7 +452,7 @@
private:
GrBatchAtlas::BulkUseTokenUpdater fBulkUseToken;
- SkAutoTUnref<GrBatchTextStrike> fStrike;
+ sk_sp<GrBatchTextStrike> fStrike;
SkMatrix fCurrentViewMatrix;
SkRect fVertexBounds;
uint64_t fAtlasGeneration;
@@ -477,7 +477,7 @@
return newSubRun;
}
static const int kMinSubRuns = 1;
- SkAutoTUnref<SkTypeface> fTypeface;
+ sk_sp<SkTypeface> fTypeface;
SkSTArray<kMinSubRuns, SubRunInfo> fSubRunInfo;
SkAutoDescriptor fDescriptor;
diff --git a/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp b/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
index 59df1fa..f0ccfc6 100644
--- a/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
+++ b/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
@@ -162,7 +162,7 @@
effects.fPathEffect = run->fPathEffect.get();
effects.fRasterizer = run->fRasterizer.get();
effects.fMaskFilter = run->fMaskFilter.get();
- lazyCache->reset(SkGlyphCache::DetachCache(run->fTypeface, effects, desc));
+ lazyCache->reset(SkGlyphCache::DetachCache(run->fTypeface.get(), effects, desc));
}
if (regenGlyphs) {
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp
index 1d6cef0..76bdfc8 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -87,7 +87,7 @@
return;
}
- SkAutoTUnref<GrAtlasTextBlob> cacheBlob;
+ sk_sp<GrAtlasTextBlob> cacheBlob;
SkMaskFilter::BlurRec blurRec;
GrAtlasTextBlob::Key key;
// It might be worth caching these things, but its not clear at this time
@@ -133,22 +133,22 @@
// We have to remake the blob because changes may invalidate our masks.
// TODO we could probably get away reuse most of the time if the pointer is unique,
// but we'd have to clear the subrun information
- cache->remove(cacheBlob);
+ cache->remove(cacheBlob.get());
cacheBlob.reset(SkRef(cache->createCachedBlob(blob, key, blurRec, skPaint)));
- RegenerateTextBlob(cacheBlob, context->getBatchFontCache(),
+ RegenerateTextBlob(cacheBlob.get(), context->getBatchFontCache(),
*context->caps()->shaderCaps(), skPaint, grPaint.getColor(),
scalerContextFlags, viewMatrix, props,
blob, x, y, drawFilter);
} else {
- cache->makeMRU(cacheBlob);
+ cache->makeMRU(cacheBlob.get());
if (CACHE_SANITY_CHECK) {
int glyphCount = 0;
int runCount = 0;
GrTextBlobCache::BlobGlyphCount(&glyphCount, &runCount, blob);
- SkAutoTUnref<GrAtlasTextBlob> sanityBlob(cache->createBlob(glyphCount, runCount));
+ sk_sp<GrAtlasTextBlob> sanityBlob(cache->createBlob(glyphCount, runCount));
sanityBlob->setupKey(key, blurRec, skPaint);
- RegenerateTextBlob(sanityBlob, context->getBatchFontCache(),
+ RegenerateTextBlob(sanityBlob.get(), context->getBatchFontCache(),
*context->caps()->shaderCaps(), skPaint,
grPaint.getColor(), scalerContextFlags, viewMatrix, props,
blob, x, y, drawFilter);
@@ -161,13 +161,13 @@
} else {
cacheBlob.reset(cache->createBlob(blob));
}
- RegenerateTextBlob(cacheBlob, context->getBatchFontCache(),
+ RegenerateTextBlob(cacheBlob.get(), context->getBatchFontCache(),
*context->caps()->shaderCaps(), skPaint, grPaint.getColor(),
scalerContextFlags, viewMatrix, props,
blob, x, y, drawFilter);
}
- cacheBlob->flushCached(context, rtc, blob, props, fDistanceAdjustTable, skPaint,
+ cacheBlob->flushCached(context, rtc, blob, props, fDistanceAdjustTable.get(), skPaint,
grPaint, drawFilter, clip, viewMatrix, clipBounds, x, y);
}
@@ -323,14 +323,14 @@
if (context->abandoned()) {
return;
} else if (this->canDraw(skPaint, viewMatrix, props, *context->caps()->shaderCaps())) {
- SkAutoTUnref<GrAtlasTextBlob> blob(
+ sk_sp<GrAtlasTextBlob> blob(
CreateDrawTextBlob(context->getTextBlobCache(), context->getBatchFontCache(),
*context->caps()->shaderCaps(),
paint, skPaint,
ComputeScalerContextFlags(rtc),
viewMatrix, props,
text, byteLength, x, y));
- blob->flushThrowaway(context, rtc, props, fDistanceAdjustTable, skPaint, paint,
+ blob->flushThrowaway(context, rtc, props, fDistanceAdjustTable.get(), skPaint, paint,
clip, viewMatrix, regionClipBounds, x, y);
return;
}
@@ -352,7 +352,7 @@
if (context->abandoned()) {
return;
} else if (this->canDraw(skPaint, viewMatrix, props, *context->caps()->shaderCaps())) {
- SkAutoTUnref<GrAtlasTextBlob> blob(
+ sk_sp<GrAtlasTextBlob> blob(
CreateDrawPosTextBlob(context->getTextBlobCache(),
context->getBatchFontCache(),
*context->caps()->shaderCaps(),
@@ -362,7 +362,7 @@
text, byteLength,
pos, scalarsPerPosition,
offset));
- blob->flushThrowaway(context, rtc, props, fDistanceAdjustTable, skPaint, paint,
+ blob->flushThrowaway(context, rtc, props, fDistanceAdjustTable.get(), skPaint, paint,
clip, viewMatrix, regionClipBounds, offset.fX, offset.fY);
return;
}
@@ -419,7 +419,7 @@
// right now we don't handle textblobs, nor do we handle drawPosText. Since we only
// intend to test the batch with this unit test, that is okay.
- SkAutoTUnref<GrAtlasTextBlob> blob(
+ sk_sp<GrAtlasTextBlob> blob(
GrAtlasTextContext::CreateDrawTextBlob(context->getTextBlobCache(),
context->getBatchFontCache(),
*context->caps()->shaderCaps(), grPaint, skPaint,
diff --git a/src/gpu/text/GrAtlasTextContext.h b/src/gpu/text/GrAtlasTextContext.h
index 20da8be..61af211 100644
--- a/src/gpu/text/GrAtlasTextContext.h
+++ b/src/gpu/text/GrAtlasTextContext.h
@@ -84,9 +84,9 @@
const SkScalar pos[],
int scalarsPerPosition,
const SkPoint& offset);
- const GrDistanceFieldAdjustTable* dfAdjustTable() const { return fDistanceAdjustTable; }
+ const GrDistanceFieldAdjustTable* dfAdjustTable() const { return fDistanceAdjustTable.get(); }
- SkAutoTUnref<const GrDistanceFieldAdjustTable> fDistanceAdjustTable;
+ sk_sp<const GrDistanceFieldAdjustTable> fDistanceAdjustTable;
#ifdef GR_TEST_UTILS
static const uint32_t kTextBlobBatchScalerContextFlags =
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp
index b3a7eef..2022e45 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -619,7 +619,7 @@
0xffff>()
);
- SkAutoTUnref<GrPathRange> glyphs(this->createGlyphs(ctx));
+ sk_sp<GrPathRange> glyphs(this->createGlyphs(ctx));
if (fLastDrawnGlyphsID != glyphs->uniqueID()) {
// Either this is the first draw or the glyphs object was purged since last draw.
glyphs->loadPathsIfNeeded(fInstanceData->indices(), fInstanceData->count());
@@ -634,17 +634,17 @@
const SkRect bounds = SkRect::MakeIWH(renderTargetContext->width(),
renderTargetContext->height());
- SkAutoTUnref<GrDrawBatch> batch(
+ sk_sp<GrDrawBatch> batch(
GrDrawPathRangeBatch::Create(viewMatrix, fTextRatio, fTextInverseRatio * x,
fTextInverseRatio * y, grPaint.getColor(),
- GrPathRendering::kWinding_FillType, glyphs, fInstanceData,
- bounds));
+ GrPathRendering::kWinding_FillType, glyphs.get(),
+ fInstanceData.get(), bounds));
GrPipelineBuilder pipelineBuilder(grPaint);
pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, grPaint.isAntiAlias());
pipelineBuilder.setUserStencil(&kCoverPass);
- renderTargetContext->drawBatch(pipelineBuilder, clip, batch);
+ renderTargetContext->drawBatch(pipelineBuilder, clip, batch.get());
}
if (fFallbackTextBlob) {
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.h b/src/gpu/text/GrStencilAndCoverTextContext.h
index 470e1e4..3cf4374 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.h
+++ b/src/gpu/text/GrStencilAndCoverTextContext.h
@@ -104,7 +104,7 @@
bool fUsingRawGlyphPaths;
GrUniqueKey fGlyphPathsKey;
int fTotalGlyphCount;
- SkAutoTUnref<InstanceData> fInstanceData;
+ sk_sp<InstanceData> fInstanceData;
int fFallbackGlyphCount;
sk_sp<SkTextBlob> fFallbackTextBlob;
mutable SkGlyphCache* fDetachedGlyphCache;
diff --git a/src/gpu/vk/GrVkCopyManager.cpp b/src/gpu/vk/GrVkCopyManager.cpp
index 68f7c31..636b650 100644
--- a/src/gpu/vk/GrVkCopyManager.cpp
+++ b/src/gpu/vk/GrVkCopyManager.cpp
@@ -354,7 +354,7 @@
scissor.offset.y = 0;
cmdBuffer->setScissor(gpu, 0, 1, &scissor);
- cmdBuffer->bindVertexBuffer(gpu, fVertexBuffer);
+ cmdBuffer->bindVertexBuffer(gpu, fVertexBuffer.get());
cmdBuffer->draw(gpu, 4, 1, 0, 0);
cmdBuffer->endRenderPass(gpu);
diff --git a/src/gpu/vk/GrVkCopyManager.h b/src/gpu/vk/GrVkCopyManager.h
index e19a144..3a92d58 100644
--- a/src/gpu/vk/GrVkCopyManager.h
+++ b/src/gpu/vk/GrVkCopyManager.h
@@ -48,8 +48,8 @@
GrVkDescriptorSetManager::Handle fSamplerDSHandle;
VkPipelineLayout fPipelineLayout;
- SkAutoTUnref<GrVkVertexBuffer> fVertexBuffer;
- GrVkUniformBuffer* fUniformBuffer;
+ sk_sp<GrVkVertexBuffer> fVertexBuffer;
+ GrVkUniformBuffer* fUniformBuffer;
};
#endif
diff --git a/src/gpu/vk/GrVkGpu.h b/src/gpu/vk/GrVkGpu.h
index 50f7471..dd1eaa1 100644
--- a/src/gpu/vk/GrVkGpu.h
+++ b/src/gpu/vk/GrVkGpu.h
@@ -255,8 +255,8 @@
const SkIRect& srcRect,
const SkIPoint& dstPoint);
- SkAutoTUnref<const GrVkBackendContext> fBackendContext;
- SkAutoTUnref<GrVkCaps> fVkCaps;
+ sk_sp<const GrVkBackendContext> fBackendContext;
+ sk_sp<GrVkCaps> fVkCaps;
// These Vulkan objects are provided by the client, and also stored in fBackendContext.
// They're copied here for convenient access.