aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/SkSpecialImage.cpp4
-rw-r--r--src/gpu/GrBitmapTextureMaker.cpp2
-rw-r--r--src/gpu/GrClipStackClip.cpp4
-rw-r--r--src/gpu/GrDrawOpAtlas.cpp82
-rw-r--r--src/gpu/GrDrawOpAtlas.h25
-rw-r--r--src/gpu/GrPathRenderer.h12
-rw-r--r--src/gpu/GrReducedClip.cpp6
-rw-r--r--src/gpu/GrRenderTargetContext.cpp4
-rw-r--r--src/gpu/GrResourceProvider.cpp36
-rw-r--r--src/gpu/GrResourceProvider.h20
-rw-r--r--src/gpu/GrSoftwarePathRenderer.cpp2
-rw-r--r--src/gpu/ops/GrAADistanceFieldPathRenderer.cpp23
-rw-r--r--src/gpu/text/GrAtlasGlyphCache.cpp2
-rw-r--r--tests/DFPathRendererTest.cpp7
-rw-r--r--tests/ImageTest.cpp2
-rw-r--r--tests/TessellatingPathRendererTests.cpp43
16 files changed, 141 insertions, 133 deletions
diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp
index c523ae833f..ad5ef4d869 100644
--- a/src/core/SkSpecialImage.cpp
+++ b/src/core/SkSpecialImage.cpp
@@ -196,7 +196,7 @@ sk_sp<SkSpecialImage> SkSpecialImage::MakeFromImage(const SkIRect& subset,
GrContext* context = ((SkImage_Gpu*) as_IB(image))->context();
return MakeDeferredFromGpu(context, subset, image->uniqueID(), std::move(proxy),
- sk_ref_sp(as_IB(image)->onImageInfo().colorSpace()), props);
+ as_IB(image)->onImageInfo().refColorSpace(), props);
} else
#endif
{
@@ -479,7 +479,7 @@ public:
if (subset) {
// TODO: if this becomes a bottle neck we could base this logic on what the size
// will be when it is finally instantiated - but that is more fraught.
- if (//fSurfaceProxy->priv().isExact() &&
+ if (fTextureProxy->priv().isExact() &&
0 == subset->fLeft && 0 == subset->fTop &&
fTextureProxy->width() == subset->width() &&
fTextureProxy->height() == subset->height()) {
diff --git a/src/gpu/GrBitmapTextureMaker.cpp b/src/gpu/GrBitmapTextureMaker.cpp
index 184640f3b1..e4ea772cc5 100644
--- a/src/gpu/GrBitmapTextureMaker.cpp
+++ b/src/gpu/GrBitmapTextureMaker.cpp
@@ -67,5 +67,5 @@ SkAlphaType GrBitmapTextureMaker::alphaType() const {
sk_sp<SkColorSpace> GrBitmapTextureMaker::getColorSpace(SkColorSpace* dstColorSpace) {
// Color space doesn't depend on destination color space - it's just whatever is in the bitmap
- return sk_ref_sp(fBitmap.colorSpace());
+ return fBitmap.refColorSpace();
}
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 375ee8ba13..0b3089bd2e 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -413,11 +413,11 @@ static void add_invalidate_on_pop_message(const SkClipStack& stack, int32_t clip
// MDB TODO (caching): this side-steps the issue of texture proxies cached by unique ID
sk_sp<GrTextureProxy> GrClipStackClip::createAlphaClipMask(GrContext* context,
const GrReducedClip& reducedClip) const {
- GrResourceProvider* resourceProvider = context->resourceProvider();
+ GrTextureProvider* texProvider = context->textureProvider();
GrUniqueKey key;
create_clip_mask_key(reducedClip.elementsGenID(), reducedClip.ibounds(), &key);
- sk_sp<GrTexture> texture(resourceProvider->findAndRefTextureByUniqueKey(key));
+ sk_sp<GrTexture> texture(texProvider->findAndRefTextureByUniqueKey(key));
if (texture) {
return GrSurfaceProxy::MakeWrapped(std::move(texture));
}
diff --git a/src/gpu/GrDrawOpAtlas.cpp b/src/gpu/GrDrawOpAtlas.cpp
index 6661b4855c..e9fd356ca3 100644
--- a/src/gpu/GrDrawOpAtlas.cpp
+++ b/src/gpu/GrDrawOpAtlas.cpp
@@ -10,8 +10,46 @@
#include "GrContext.h"
#include "GrOpFlushState.h"
#include "GrRectanizer.h"
+#include "GrResourceProvider.h"
#include "GrTracing.h"
+std::unique_ptr<GrDrawOpAtlas> GrDrawOpAtlas::Make(GrContext* ctx, GrPixelConfig config,
+ int width, int height,
+ int numPlotsX, int numPlotsY,
+ GrDrawOpAtlas::EvictionFunc func,
+ void* data) {
+ GrSurfaceDesc desc;
+ desc.fFlags = kNone_GrSurfaceFlags;
+ desc.fWidth = width;
+ desc.fHeight = height;
+ desc.fConfig = config;
+
+ // We don't want to flush the context so we claim we're in the middle of flushing so as to
+ // guarantee we do not recieve a texture with pending IO
+ // TODO: Determine how to avoid having to do this. (https://bug.skia.org/4156)
+ static const uint32_t kFlags = GrResourceProvider::kNoPendingIO_Flag;
+ sk_sp<GrTexture> texture(ctx->textureProvider()->createApproxTexture(desc, kFlags));
+ if (!texture) {
+ return nullptr;
+ }
+
+ // MDB TODO: for now, wrap an instantiated texture. Having the deferred instantiation
+ // possess the correct properties (e.g., no pendingIO) should fall out of the system but
+ // should receive special attention.
+ // Note: When switching over to the deferred proxy, use the kExact flag to create
+ // the atlas and assert that the width & height are powers of 2.
+ sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeWrapped(std::move(texture));
+ if (!proxy) {
+ return nullptr;
+ }
+
+ std::unique_ptr<GrDrawOpAtlas> atlas(
+ new GrDrawOpAtlas(ctx, std::move(proxy), numPlotsX, numPlotsY));
+ atlas->registerEvictionCallback(func, data);
+ return atlas;
+}
+
+
////////////////////////////////////////////////////////////////////////////////
GrDrawOpAtlas::Plot::Plot(int index, uint64_t genID, int offX, int offY, int width, int height,
@@ -160,7 +198,7 @@ void GrDrawOpAtlas::processEviction(AtlasID id) {
}
}
-inline void GrDrawOpAtlas::updatePlot(GrDrawOp::Target* target, AtlasID* id, Plot* plot) {
+inline bool GrDrawOpAtlas::updatePlot(GrDrawOp::Target* target, AtlasID* id, Plot* plot) {
this->makeMRU(plot);
// If our most recent upload has already occurred then we have to insert a new
@@ -169,19 +207,23 @@ inline void GrDrawOpAtlas::updatePlot(GrDrawOp::Target* target, AtlasID* id, Plo
if (target->hasDrawBeenFlushed(plot->lastUploadToken())) {
// With c+14 we could move sk_sp into lamba to only ref once.
sk_sp<Plot> plotsp(SkRef(plot));
+
// MDB TODO: this is currently fine since the atlas' proxy is always pre-instantiated.
// Once it is deferred more care must be taken upon instantiation failure.
GrTexture* texture = fProxy->instantiate(fContext->textureProvider());
- if (texture) {
- GrDrawOpUploadToken lastUploadToken = target->addAsapUpload(
- [plotsp, texture] (GrDrawOp::WritePixelsFn& writePixels) {
- plotsp->uploadToTexture(writePixels, texture);
- }
- );
- plot->setLastUploadToken(lastUploadToken);
+ if (!texture) {
+ return false;
}
+
+ GrDrawOpUploadToken lastUploadToken = target->addAsapUpload(
+ [plotsp, texture] (GrDrawOp::WritePixelsFn& writePixels) {
+ plotsp->uploadToTexture(writePixels, texture);
+ }
+ );
+ plot->setLastUploadToken(lastUploadToken);
}
*id = plot->id();
+ return true;
}
bool GrDrawOpAtlas::addToAtlas(AtlasID* id, GrDrawOp::Target* target, int width, int height,
@@ -199,8 +241,7 @@ bool GrDrawOpAtlas::addToAtlas(AtlasID* id, GrDrawOp::Target* target, int width,
while ((plot = plotIter.get())) {
SkASSERT(GrBytesPerPixel(fProxy->desc().fConfig) == plot->bpp());
if (plot->addSubImage(width, height, image, loc)) {
- this->updatePlot(target, id, plot);
- return true;
+ return this->updatePlot(target, id, plot);
}
plotIter.next();
}
@@ -215,7 +256,10 @@ bool GrDrawOpAtlas::addToAtlas(AtlasID* id, GrDrawOp::Target* target, int width,
SkASSERT(GrBytesPerPixel(fProxy->desc().fConfig) == plot->bpp());
SkDEBUGCODE(bool verify = )plot->addSubImage(width, height, image, loc);
SkASSERT(verify);
- this->updatePlot(target, id, plot);
+ if (!this->updatePlot(target, id, plot)) {
+ return false;
+ }
+
fAtlasGeneration++;
return true;
}
@@ -246,15 +290,17 @@ bool GrDrawOpAtlas::addToAtlas(AtlasID* id, GrDrawOp::Target* target, int width,
// MDB TODO: this is currently fine since the atlas' proxy is always pre-instantiated.
// Once it is deferred more care must be taken upon instantiation failure.
GrTexture* texture = fProxy->instantiate(fContext->textureProvider());
- if (texture) {
- GrDrawOpUploadToken lastUploadToken = target->addInlineUpload(
- [plotsp, texture] (GrDrawOp::WritePixelsFn& writePixels) {
- plotsp->uploadToTexture(writePixels, texture);
- }
- );
- newPlot->setLastUploadToken(lastUploadToken);
+ if (!texture) {
+ return false;
}
+ GrDrawOpUploadToken lastUploadToken = target->addInlineUpload(
+ [plotsp, texture] (GrDrawOp::WritePixelsFn& writePixels) {
+ plotsp->uploadToTexture(writePixels, texture);
+ }
+ );
+ newPlot->setLastUploadToken(lastUploadToken);
+
*id = newPlot->id();
fAtlasGeneration++;
diff --git a/src/gpu/GrDrawOpAtlas.h b/src/gpu/GrDrawOpAtlas.h
index 917d4ecab6..c857d07703 100644
--- a/src/gpu/GrDrawOpAtlas.h
+++ b/src/gpu/GrDrawOpAtlas.h
@@ -55,7 +55,26 @@ public:
*/
typedef void (*EvictionFunc)(GrDrawOpAtlas::AtlasID, void*);
- GrDrawOpAtlas(GrContext*, sk_sp<GrTextureProxy>, int numPlotsX, int numPlotsY);
+ /**
+ * Returns a GrDrawOpAtlas. This function can be called anywhere, but the returned atlas
+ * should only be used inside of GrMeshDrawOp::onPrepareDraws.
+ * @param GrPixelConfig The pixel config which this atlas will store
+ * @param width width in pixels of the atlas
+ * @param height height in pixels of the atlas
+ * @param numPlotsX The number of plots the atlas should be broken up into in the X
+ * direction
+ * @param numPlotsY The number of plots the atlas should be broken up into in the Y
+ * direction
+ * @param func An eviction function which will be called whenever the atlas has to
+ * evict data
+ * @param data User supplied data which will be passed into func whenver an
+ * eviction occurs
+ * @return An initialized GrDrawOpAtlas, or nullptr if creation fails
+ */
+ static std::unique_ptr<GrDrawOpAtlas> Make(GrContext*, GrPixelConfig,
+ int width, int height,
+ int numPlotsX, int numPlotsY,
+ GrDrawOpAtlas::EvictionFunc func, void* data);
/**
* Adds a width x height subimage to the atlas. Upon success it returns an ID and the subimage's
@@ -158,6 +177,8 @@ public:
}
private:
+ GrDrawOpAtlas(GrContext*, sk_sp<GrTextureProxy>, int numPlotsX, int numPlotsY);
+
/**
* The backing GrTexture for a GrDrawOpAtlas is broken into a spatial grid of Plots. The Plots
* keep track of subimage placement via their GrRectanizer. A Plot manages the lifetime of its
@@ -253,7 +274,7 @@ private:
return (id >> 16) & 0xffffffffffff;
}
- inline void updatePlot(GrDrawOp::Target*, AtlasID*, Plot*);
+ inline bool updatePlot(GrDrawOp::Target*, AtlasID*, Plot*);
inline void makeMRU(Plot* plot) {
if (fPlotList.head() == plot) {
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h
index f1164a9503..05673d5f86 100644
--- a/src/gpu/GrPathRenderer.h
+++ b/src/gpu/GrPathRenderer.h
@@ -124,7 +124,7 @@ public:
* fGammaCorrect true if gamma-correct rendering is to be used.
*/
struct DrawPathArgs {
- GrResourceProvider* fResourceProvider;
+ GrContext* fContext;
GrPaint&& fPaint;
const GrUserStencilSettings* fUserStencilSettings;
GrRenderTargetContext* fRenderTargetContext;
@@ -135,7 +135,7 @@ public:
bool fGammaCorrect;
#ifdef SK_DEBUG
void validate() const {
- SkASSERT(fResourceProvider);
+ SkASSERT(fContext);
SkASSERT(fUserStencilSettings);
SkASSERT(fRenderTargetContext);
SkASSERT(fClip);
@@ -153,7 +153,7 @@ public:
SkDEBUGCODE(args.validate();)
#ifdef SK_DEBUG
CanDrawPathArgs canArgs;
- canArgs.fShaderCaps = args.fResourceProvider->caps()->shaderCaps();
+ canArgs.fShaderCaps = args.fContext->caps()->shaderCaps();
canArgs.fViewMatrix = args.fViewMatrix;
canArgs.fShape = args.fShape;
canArgs.fAAType = args.fAAType;
@@ -183,7 +183,7 @@ public:
* fAAType The type of AA, cannot be kCoverage.
*/
struct StencilPathArgs {
- GrResourceProvider* fResourceProvider;
+ GrContext* fContext;
GrRenderTargetContext* fRenderTargetContext;
const GrClip* fClip;
const SkMatrix* fViewMatrix;
@@ -192,7 +192,7 @@ public:
#ifdef SK_DEBUG
void validate() const {
- SkASSERT(fResourceProvider);
+ SkASSERT(fContext);
SkASSERT(fRenderTargetContext);
SkASSERT(fViewMatrix);
SkASSERT(fShape);
@@ -277,7 +277,7 @@ private:
GrPaint paint;
- DrawPathArgs drawArgs{args.fResourceProvider,
+ DrawPathArgs drawArgs{args.fContext,
std::move(paint),
&kIncrementStencil,
args.fRenderTargetContext,
diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp
index 4dd81c26ce..8105ed46bf 100644
--- a/src/gpu/GrReducedClip.cpp
+++ b/src/gpu/GrReducedClip.cpp
@@ -781,7 +781,7 @@ bool GrReducedClip::drawStencilClipMask(GrContext* context,
GrPaint paint;
paint.setXPFactory(GrDisableColorXPFactory::Get());
- GrPathRenderer::DrawPathArgs args{context->resourceProvider(),
+ GrPathRenderer::DrawPathArgs args{context,
std::move(paint),
&kDrawToStencil,
renderTargetContext,
@@ -793,7 +793,7 @@ bool GrReducedClip::drawStencilClipMask(GrContext* context,
pr->drawPath(args);
} else {
GrPathRenderer::StencilPathArgs args;
- args.fResourceProvider = context->resourceProvider();
+ args.fContext = context;
args.fRenderTargetContext = renderTargetContext;
args.fClip = &stencilClip.fixedClip();
args.fViewMatrix = &viewMatrix;
@@ -816,7 +816,7 @@ bool GrReducedClip::drawStencilClipMask(GrContext* context,
GrShape shape(clipPath, GrStyle::SimpleFill());
GrPaint paint;
paint.setXPFactory(GrDisableColorXPFactory::Get());
- GrPathRenderer::DrawPathArgs args{context->resourceProvider(),
+ GrPathRenderer::DrawPathArgs args{context,
std::move(paint),
*pass,
renderTargetContext,
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index a980818cc1..8b6de51e64 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -1496,7 +1496,7 @@ bool GrRenderTargetContextPriv::drawAndStencilPath(const GrClip& clip,
paint.setCoverageSetOpXPFactory(op, invert);
GrPathRenderer::DrawPathArgs args{
- fRenderTargetContext->drawingManager()->getContext()->resourceProvider(),
+ fRenderTargetContext->drawingManager()->getContext(),
std::move(paint),
ss,
fRenderTargetContext,
@@ -1593,7 +1593,7 @@ void GrRenderTargetContext::internalDrawPath(const GrClip& clip,
return;
}
- GrPathRenderer::DrawPathArgs args{this->drawingManager()->getContext()->resourceProvider(),
+ GrPathRenderer::DrawPathArgs args{this->drawingManager()->getContext(),
std::move(paint),
&GrUserStencilSettings::kUnused,
this,
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 2dd17b7569..deb400c371 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -135,42 +135,6 @@ GrBuffer* GrResourceProvider::createBuffer(size_t size, GrBufferType intendedTyp
return buffer;
}
-std::unique_ptr<GrDrawOpAtlas> GrResourceProvider::makeAtlas(GrContext* context,
- GrPixelConfig config, int width,
- int height, int numPlotsX,
- int numPlotsY,
- GrDrawOpAtlas::EvictionFunc func,
- void* data) {
- GrSurfaceDesc desc;
- desc.fFlags = kNone_GrSurfaceFlags;
- desc.fWidth = width;
- desc.fHeight = height;
- desc.fConfig = config;
-
- // We don't want to flush the context so we claim we're in the middle of flushing so as to
- // guarantee we do not recieve a texture with pending IO
- // TODO: Determine how to avoid having to do this. (https://bug.skia.org/4156)
- static const uint32_t kFlags = GrResourceProvider::kNoPendingIO_Flag;
- sk_sp<GrTexture> texture(this->createApproxTexture(desc, kFlags));
- if (!texture) {
- return nullptr;
- }
- // MDB TODO: for now, wrap an instantiated texture. Having the deferred instantiation
- // possess the correct properties (e.g., no pendingIO) should fall out of the system but
- // should receive special attention.
- // Note: When switching over to the deferred proxy, use the kExact flag to create
- // the atlas.
- sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeWrapped(std::move(texture));
- if (!proxy) {
- return nullptr;
- }
-
- std::unique_ptr<GrDrawOpAtlas> atlas(
- new GrDrawOpAtlas(context, std::move(proxy), numPlotsX, numPlotsY));
- atlas->registerEvictionCallback(func, data);
- return atlas;
-}
-
GrStencilAttachment* GrResourceProvider::attachStencilAttachment(GrRenderTarget* rt) {
SkASSERT(rt);
if (rt->renderTargetPriv().getStencilAttachment()) {
diff --git a/src/gpu/GrResourceProvider.h b/src/gpu/GrResourceProvider.h
index 091d2dbf16..c0d1a50230 100644
--- a/src/gpu/GrResourceProvider.h
+++ b/src/gpu/GrResourceProvider.h
@@ -131,26 +131,6 @@ public:
}
/**
- * Returns a GrDrawOpAtlas. This function can be called anywhere, but the returned atlas
- * should only be used inside of GrMeshDrawOp::onPrepareDraws.
- * @param GrPixelConfig The pixel config which this atlas will store
- * @param width width in pixels of the atlas
- * @param height height in pixels of the atlas
- * @param numPlotsX The number of plots the atlas should be broken up into in the X
- * direction
- * @param numPlotsY The number of plots the atlas should be broken up into in the Y
- * direction
- * @param func An eviction function which will be called whenever the atlas has to
- * evict data
- * @param data User supplied data which will be passed into func whenver an
- * eviction occurs
- * @return An initialized GrDrawOpAtlas, or nullptr if creation fails
- */
- std::unique_ptr<GrDrawOpAtlas> makeAtlas(GrContext*, GrPixelConfig, int width, int height,
- int numPlotsX, int numPlotsY,
- GrDrawOpAtlas::EvictionFunc func, void* data);
-
- /**
* If passed in render target already has a stencil buffer, return it. Otherwise attempt to
* attach one.
*/
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index 695796b13e..5ed9f42446 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -206,7 +206,7 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
sk_sp<GrTexture> texture;
if (useCache) {
- texture.reset(args.fResourceProvider->findAndRefTextureByUniqueKey(maskKey));
+ texture.reset(args.fContext->textureProvider()->findAndRefTextureByUniqueKey(maskKey));
}
if (!texture) {
SkBackingFit fit = useCache ? SkBackingFit::kExact : SkBackingFit::kApprox;
diff --git a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp
index b4c0c526fb..a856ba6f58 100644
--- a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp
@@ -746,12 +746,12 @@ bool GrAADistanceFieldPathRenderer::onDrawPath(const DrawPathArgs& args) {
SkASSERT(!args.fShape->isEmpty());
SkASSERT(args.fShape->hasUnstyledKey());
if (!fAtlas) {
- fAtlas = args.fResourceProvider->makeAtlas(args.fResourceProvider->context(),
- kAlpha_8_GrPixelConfig,
- ATLAS_TEXTURE_WIDTH, ATLAS_TEXTURE_HEIGHT,
- NUM_PLOTS_X, NUM_PLOTS_Y,
- &GrAADistanceFieldPathRenderer::HandleEviction,
- (void*)this);
+ fAtlas = GrDrawOpAtlas::Make(args.fContext,
+ kAlpha_8_GrPixelConfig,
+ ATLAS_TEXTURE_WIDTH, ATLAS_TEXTURE_HEIGHT,
+ NUM_PLOTS_X, NUM_PLOTS_Y,
+ &GrAADistanceFieldPathRenderer::HandleEviction,
+ (void*)this);
if (!fAtlas) {
return false;
}
@@ -820,12 +820,11 @@ DRAW_OP_TEST_DEFINE(AADistanceFieldPathOp) {
if (context->uniqueID() != gTestStruct.fContextID) {
gTestStruct.fContextID = context->uniqueID();
gTestStruct.reset();
- gTestStruct.fAtlas =
- context->resourceProvider()->makeAtlas(context, kAlpha_8_GrPixelConfig,
- ATLAS_TEXTURE_WIDTH, ATLAS_TEXTURE_HEIGHT,
- NUM_PLOTS_X, NUM_PLOTS_Y,
- &PathTestStruct::HandleEviction,
- (void*)&gTestStruct);
+ gTestStruct.fAtlas = GrDrawOpAtlas::Make(context, kAlpha_8_GrPixelConfig,
+ ATLAS_TEXTURE_WIDTH, ATLAS_TEXTURE_HEIGHT,
+ NUM_PLOTS_X, NUM_PLOTS_Y,
+ &PathTestStruct::HandleEviction,
+ (void*)&gTestStruct);
}
SkMatrix viewMatrix = GrTest::TestMatrix(random);
diff --git a/src/gpu/text/GrAtlasGlyphCache.cpp b/src/gpu/text/GrAtlasGlyphCache.cpp
index cf56c897d6..213ecfc3da 100644
--- a/src/gpu/text/GrAtlasGlyphCache.cpp
+++ b/src/gpu/text/GrAtlasGlyphCache.cpp
@@ -26,7 +26,7 @@ bool GrAtlasGlyphCache::initAtlas(GrMaskFormat format) {
int numPlotsX = fAtlasConfigs[index].numPlotsX();
int numPlotsY = fAtlasConfigs[index].numPlotsY();
- fAtlases[index] = fContext->resourceProvider()->makeAtlas(
+ fAtlases[index] = GrDrawOpAtlas::Make(
fContext, config, width, height, numPlotsX, numPlotsY,
&GrAtlasGlyphCache::HandleEviction, (void*)this);
if (!fAtlases[index]) {
diff --git a/tests/DFPathRendererTest.cpp b/tests/DFPathRendererTest.cpp
index ced13f3ac5..96ccbd7394 100644
--- a/tests/DFPathRendererTest.cpp
+++ b/tests/DFPathRendererTest.cpp
@@ -18,8 +18,7 @@
// Because of inaccuracies in large floating point values this causes the
// the path renderer to attempt to add a path DF to its atlas that is larger
// than the plot size which used to crash rather than fail gracefully.
-static void test_far_from_origin(GrResourceProvider* rp,
- GrRenderTargetContext* renderTargetContext,
+static void test_far_from_origin(GrContext* ctx, GrRenderTargetContext* renderTargetContext,
GrPathRenderer* pr) {
SkPath path;
path.lineTo(49.0255089839f, 0.473541f);
@@ -47,7 +46,7 @@ static void test_far_from_origin(GrResourceProvider* rp,
paint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc));
GrNoClip noClip;
- GrPathRenderer::DrawPathArgs args{rp,
+ GrPathRenderer::DrawPathArgs args{ctx,
std::move(paint),
&GrUserStencilSettings::kUnused,
renderTargetContext,
@@ -78,7 +77,7 @@ DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(AADistanceFieldPathRenderer, reporter, ctxInfo)
GrAADistanceFieldPathRenderer dfpr;
ctx->flush();
- test_far_from_origin(ctx->resourceProvider(), rtc.get(), &dfpr);
+ test_far_from_origin(ctx, rtc.get(), &dfpr);
ctx->flush();
}
#endif
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index d8a0633af0..83f9e81af3 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -507,7 +507,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkImage_makeTextureImage, reporter, contextIn
sk_sp<SkImage> texImage(image->makeTextureImage(context, dstColorSpace.get()));
if (!texImage) {
- // We execpt to fail if image comes from a different GrContext.
+ // We expect to fail if image comes from a different GrContext.
if (!origTexture || origTexture->getContext() == context) {
ERRORF(reporter, "makeTextureImage failed.");
}
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp
index f429df363d..548be4b3a5 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -270,7 +270,7 @@ static sk_sp<GrFragmentProcessor> create_linear_gradient_processor(GrContext* ct
return shader->asFragmentProcessor(args);
}
-static void test_path(GrResourceProvider* rp,
+static void test_path(GrContext* ctx,
GrRenderTargetContext* renderTargetContext,
const SkPath& path,
const SkMatrix& matrix = SkMatrix::I(),
@@ -287,7 +287,7 @@ static void test_path(GrResourceProvider* rp,
GrNoClip noClip;
GrStyle style(SkStrokeRec::kFill_InitStyle);
GrShape shape(path, style);
- GrPathRenderer::DrawPathArgs args{rp,
+ GrPathRenderer::DrawPathArgs args{ctx,
std::move(paint),
&GrUserStencilSettings::kUnused,
renderTargetContext,
@@ -301,6 +301,7 @@ static void test_path(GrResourceProvider* rp,
DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) {
GrContext* ctx = ctxInfo.grContext();
+
sk_sp<GrRenderTargetContext> rtc(ctx->makeRenderTargetContext(SkBackingFit::kApprox,
800, 800,
kRGBA_8888_GrPixelConfig,
@@ -311,28 +312,26 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) {
return;
}
- GrResourceProvider* rp = ctx->resourceProvider();
-
ctx->flush();
- test_path(rp, rtc.get(), create_path_0());
- test_path(rp, rtc.get(), create_path_1());
- test_path(rp, rtc.get(), create_path_2());
- test_path(rp, rtc.get(), create_path_3());
- test_path(rp, rtc.get(), create_path_4());
- test_path(rp, rtc.get(), create_path_5());
- test_path(rp, rtc.get(), create_path_6());
- test_path(rp, rtc.get(), create_path_7());
- test_path(rp, rtc.get(), create_path_8());
- test_path(rp, rtc.get(), create_path_9());
- test_path(rp, rtc.get(), create_path_10());
- test_path(rp, rtc.get(), create_path_11());
- test_path(rp, rtc.get(), create_path_12());
- test_path(rp, rtc.get(), create_path_13());
- test_path(rp, rtc.get(), create_path_14());
- test_path(rp, rtc.get(), create_path_15());
- test_path(rp, rtc.get(), create_path_16());
+ test_path(ctx, rtc.get(), create_path_0());
+ test_path(ctx, rtc.get(), create_path_1());
+ test_path(ctx, rtc.get(), create_path_2());
+ test_path(ctx, rtc.get(), create_path_3());
+ test_path(ctx, rtc.get(), create_path_4());
+ test_path(ctx, rtc.get(), create_path_5());
+ test_path(ctx, rtc.get(), create_path_6());
+ test_path(ctx, rtc.get(), create_path_7());
+ test_path(ctx, rtc.get(), create_path_8());
+ test_path(ctx, rtc.get(), create_path_9());
+ test_path(ctx, rtc.get(), create_path_10());
+ test_path(ctx, rtc.get(), create_path_11());
+ test_path(ctx, rtc.get(), create_path_12());
+ test_path(ctx, rtc.get(), create_path_13());
+ test_path(ctx, rtc.get(), create_path_14());
+ test_path(ctx, rtc.get(), create_path_15());
+ test_path(ctx, rtc.get(), create_path_16());
SkMatrix nonInvertibleMatrix = SkMatrix::MakeScale(0, 0);
sk_sp<GrFragmentProcessor> fp(create_linear_gradient_processor(ctx));
- test_path(rp, rtc.get(), create_path_17(), nonInvertibleMatrix, GrAAType::kCoverage, fp);
+ test_path(ctx, rtc.get(), create_path_17(), nonInvertibleMatrix, GrAAType::kCoverage, fp);
}
#endif