class GrBatchFontCache;
class GrCaps;
struct GrContextOptions;
+class GrDrawingManager;
class GrDrawContext;
class GrDrawTarget;
class GrFragmentProcessor;
/**
* Returns a helper object to orchestrate draws.
- * Callers should take a ref if they rely on the GrDrawContext sticking around.
+ * Callers assume the creation ref of the drawContext
* NULL will be returned if the context has been abandoned.
*
* @param rt the render target receiving the draws
*
* @return a draw context
*/
- GrDrawContext* drawContext(GrRenderTarget* rt, const SkSurfaceProps* surfaceProps = NULL) {
- return fDrawingMgr.drawContext(rt, surfaceProps);
- }
-
- GrTextContext* textContext(const SkSurfaceProps& surfaceProps, GrRenderTarget* rt) {
- return fDrawingMgr.textContext(surfaceProps, rt);
- }
-
- // The caller automatically gets a ref on the returned drawTarget. It must
- // be balanced by an unref call.
- GrDrawTarget* newDrawTarget(GrRenderTarget* rt) {
- return fDrawingMgr.newDrawTarget(rt);
- }
+ GrDrawContext* drawContext(GrRenderTarget* rt, const SkSurfaceProps* surfaceProps = NULL);
///////////////////////////////////////////////////////////////////////////
// Misc.
GrBatchFontCache* getBatchFontCache() { return fBatchFontCache; }
GrLayerCache* getLayerCache() { return fLayerCache.get(); }
GrTextBlobCache* getTextBlobCache() { return fTextBlobCache; }
- bool abandoned() const { return fDrawingMgr.abandoned(); }
+ bool abandoned() const;
GrResourceProvider* resourceProvider() { return fResourceProvider; }
const GrResourceProvider* resourceProvider() const { return fResourceProvider; }
GrResourceCache* getResourceCache() { return fResourceCache; }
const uint32_t fUniqueID;
+ SkAutoTDelete<GrDrawingManager> fDrawingManager;
+
GrContext(); // init must be called after the constructor.
bool init(GrBackend, GrBackendContext, const GrContextOptions& options);
- // Currently the DrawingMgr creates a separate GrTextContext for each
- // combination of text drawing options (pixel geometry x DFT use)
- // and hands the appropriate one back given the DrawContext's request.
- //
- // It allocates a new GrDrawContext for each GrRenderTarget
- // but all of them still land in the same GrDrawTarget!
- //
- // In the future this class will allocate a new GrDrawContext for
- // each GrRenderTarget/GrDrawTarget and manage the DAG.
- class DrawingMgr {
- public:
- DrawingMgr()
- : fContext(nullptr)
- , fAbandoned(false)
- , fNVPRTextContext(nullptr) {
- sk_bzero(fTextContexts, sizeof(fTextContexts));
- }
-
- ~DrawingMgr();
-
- void init(GrContext* context);
-
- void abandon();
- bool abandoned() const { return fAbandoned; }
-
- void reset();
- void flush();
-
- // Callers assume the creation ref of the drawContext!
- // NULL will be returned if the context has been abandoned.
- GrDrawContext* drawContext(GrRenderTarget* rt, const SkSurfaceProps* surfaceProps);
-
- GrTextContext* textContext(const SkSurfaceProps& props, GrRenderTarget* rt);
-
- GrDrawTarget* newDrawTarget(GrRenderTarget* rt);
-
- private:
- void cleanup();
-
- friend class GrContext; // for access to fDrawTarget for testing
-
- static const int kNumPixelGeometries = 5; // The different pixel geometries
- static const int kNumDFTOptions = 2; // DFT or no DFT
-
- GrContext* fContext;
-
- bool fAbandoned;
- SkTDArray<GrDrawTarget*> fDrawTargets;
-
- GrTextContext* fNVPRTextContext;
- GrTextContext* fTextContexts[kNumPixelGeometries][kNumDFTOptions];
- };
-
- DrawingMgr fDrawingMgr;
-
void initMockContext();
void initCommon();
class GrClip;
class GrContext;
class GrDrawBatch;
+class GrDrawingManager;
class GrDrawTarget;
class GrPaint;
class GrPathProcessor;
private:
friend class GrAtlasTextContext; // for access to drawBatch
- friend class GrContext; // for ctor
+ friend class GrDrawingManager; // for ctor
SkDEBUGCODE(void validate() const;)
- GrDrawContext(GrContext*, GrRenderTarget*, const SkSurfaceProps* surfaceProps);
+ GrDrawContext(GrDrawingManager*, GrRenderTarget*, const SkSurfaceProps* surfaceProps);
void internalDrawPath(GrDrawTarget*,
GrPipelineBuilder*,
GrDrawTarget* getDrawTarget();
- GrContext* fContext; // owning context -> no ref
- GrRenderTarget* fRenderTarget;
+ GrDrawingManager* fDrawingManager;
+ GrRenderTarget* fRenderTarget;
// In MDB-mode the drawTarget can be closed by some other drawContext that has picked
// it up. For this reason, the drawTarget should only ever be accessed via 'getDrawTarget'.
- GrDrawTarget* fDrawTarget;
- GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingMgr
+ GrDrawTarget* fDrawTarget;
+ GrTextContext* fTextContext; // lazily gotten from GrContext::DrawingManager
- SkSurfaceProps fSurfaceProps;
+ SkSurfaceProps fSurfaceProps;
};
#endif
SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height());
SkAutoTUnref<GrDrawContext> dstDrawContext(
- context->drawContext(dstTexture->asRenderTarget()));
+ context->drawContext(dstTexture->asRenderTarget()));
if (!dstDrawContext) {
return nullptr;
}
SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height());
SkAutoTUnref<GrDrawContext> dstDrawContext(
- context->drawContext(dstTexture->asRenderTarget()));
+ context->drawContext(dstTexture->asRenderTarget()));
if (!dstDrawContext) {
return nullptr;
}
scale_rect(&dstRect, (float) scaleFactorX, (float) scaleFactorY);
SkAutoTUnref<GrDrawContext> dstDrawContext(
- context->drawContext(dstTexture->asRenderTarget()));
+ context->drawContext(dstTexture->asRenderTarget()));
if (!dstDrawContext) {
return nullptr;
}
if (nullptr == scratch) {
return false;
}
- SkAutoTUnref<GrDrawContext> dstDrawContext(context->drawContext(scratch->asRenderTarget()));
+ SkAutoTUnref<GrDrawContext> dstDrawContext(
+ context->drawContext(scratch->asRenderTarget()));
if (!dstDrawContext) {
return false;
}
if (nullptr == scratch) {
return false;
}
- SkAutoTUnref<GrDrawContext> dstDrawContext(context->drawContext(scratch->asRenderTarget()));
+ SkAutoTUnref<GrDrawContext> dstDrawContext(
+ context->drawContext(scratch->asRenderTarget()));
if (!dstDrawContext) {
return false;
}
#include "GrCaps.h"
#include "GrContextOptions.h"
#include "GrDefaultGeoProcFactory.h"
+#include "GrDrawingManager.h"
#include "GrDrawContext.h"
#include "GrDrawTarget.h"
#include "GrGpuResource.h"
#include "effects/GrSingleTextureEffect.h"
#define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == this)
-#define RETURN_IF_ABANDONED if (fDrawingMgr.abandoned()) { return; }
-#define RETURN_FALSE_IF_ABANDONED if (fDrawingMgr.abandoned()) { return false; }
-#define RETURN_NULL_IF_ABANDONED if (fDrawingMgr.abandoned()) { return nullptr; }
+#define RETURN_IF_ABANDONED if (fDrawingManager->abandoned()) { return; }
+#define RETURN_FALSE_IF_ABANDONED if (fDrawingManager->abandoned()) { return false; }
+#define RETURN_NULL_IF_ABANDONED if (fDrawingManager->abandoned()) { return nullptr; }
////////////////////////////////////////////////////////////////////////////////
-void GrContext::DrawingMgr::init(GrContext* context) {
- fContext = context;
-}
-
-void GrContext::DrawingMgr::cleanup() {
+void GrDrawingManager::cleanup() {
for (int i = 0; i < fDrawTargets.count(); ++i) {
fDrawTargets[i]->unref();
}
}
}
-GrContext::DrawingMgr::~DrawingMgr() {
+GrDrawingManager::~GrDrawingManager() {
this->cleanup();
}
-void GrContext::DrawingMgr::abandon() {
+void GrDrawingManager::abandon() {
fAbandoned = true;
this->cleanup();
}
-void GrContext::DrawingMgr::reset() {
+void GrDrawingManager::reset() {
for (int i = 0; i < fDrawTargets.count(); ++i) {
fDrawTargets[i]->reset();
}
}
-void GrContext::DrawingMgr::flush() {
+void GrDrawingManager::flush() {
for (int i = 0; i < fDrawTargets.count(); ++i) {
fDrawTargets[i]->flush();
}
}
-GrTextContext* GrContext::DrawingMgr::textContext(const SkSurfaceProps& props,
- GrRenderTarget* rt) {
+GrTextContext* GrDrawingManager::textContext(const SkSurfaceProps& props,
+ GrRenderTarget* rt) {
if (this->abandoned()) {
return nullptr;
}
return fTextContexts[props.pixelGeometry()][useDIF];
}
-GrDrawTarget* GrContext::DrawingMgr::newDrawTarget(GrRenderTarget* rt) {
+GrDrawTarget* GrDrawingManager::newDrawTarget(GrRenderTarget* rt) {
SkASSERT(fContext);
// When MDB is disabled we always just return the single drawTarget
#ifndef ENABLE_MDB
if (fDrawTargets.count()) {
SkASSERT(fDrawTargets.count() == 1);
- // DrawingMgr gets the creation ref - this ref is for the caller
+ // DrawingManager gets the creation ref - this ref is for the caller
return SkRef(fDrawTargets[0]);
}
#endif
*fDrawTargets.append() = dt;
- // DrawingMgr gets the creation ref - this ref is for the caller
+ // DrawingManager gets the creation ref - this ref is for the caller
return SkRef(dt);
}
-GrDrawContext* GrContext::DrawingMgr::drawContext(GrRenderTarget* rt,
- const SkSurfaceProps* surfaceProps) {
+GrDrawContext* GrDrawingManager::drawContext(GrRenderTarget* rt,
+ const SkSurfaceProps* surfaceProps) {
if (this->abandoned()) {
return nullptr;
}
- return new GrDrawContext(fContext, rt, surfaceProps);
+ return new GrDrawContext(this, rt, surfaceProps);
}
////////////////////////////////////////////////////////////////////////////////
fDidTestPMConversions = false;
- fDrawingMgr.init(this);
+ fDrawingManager.reset(new GrDrawingManager(this));
// GrBatchFontCache will eventually replace GrFontCache
fBatchFontCache = new GrBatchFontCache(this);
this->flush();
- fDrawingMgr.cleanup();
+ fDrawingManager->cleanup();
for (int i = 0; i < fCleanUpData.count(); ++i) {
(*fCleanUpData[i].fFunc)(this, fCleanUpData[i].fInfo);
SkSafeSetNull(fPathRendererChain);
SkSafeSetNull(fSoftwarePathRenderer);
- fDrawingMgr.abandon();
+ fDrawingManager->abandon();
fBatchFontCache->freeAll();
fLayerCache->freeAll();
RETURN_IF_ABANDONED
if (kDiscard_FlushBit & flagsBitfield) {
- fDrawingMgr.reset();
+ fDrawingManager->reset();
} else {
- fDrawingMgr.flush();
+ fDrawingManager->flush();
}
fResourceCache->notifyFlushOccurred();
fFlushToReduceCacheSize = false;
chosenSampleCount : 0;
}
+
+GrDrawContext* GrContext::drawContext(GrRenderTarget* rt, const SkSurfaceProps* surfaceProps) {
+ return fDrawingManager->drawContext(rt, surfaceProps);
+}
+
+bool GrContext::abandoned() const {
+ return fDrawingManager->abandoned();
+}
+
namespace {
void test_pm_conversions(GrContext* ctx, int* pmToUPMValue, int* upmToPMValue) {
GrConfigConversionEffect::PMConversion pmToUPM;
#include "GrBatchTest.h"
#include "GrColor.h"
#include "GrDrawContext.h"
+#include "GrDrawingManager.h"
#include "GrOvalRenderer.h"
#include "GrPathRenderer.h"
#include "GrRenderTarget.h"
#include "batches/GrDrawVerticesBatch.h"
#include "batches/GrRectBatchFactory.h"
-#define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == fContext)
-#define RETURN_IF_ABANDONED if (fContext->abandoned()) { return; }
-#define RETURN_FALSE_IF_ABANDONED if (fContext->abandoned()) { return false; }
-#define RETURN_NULL_IF_ABANDONED if (fContext->abandoned()) { return nullptr; }
+#define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == fDrawingManager->getContext())
+#define RETURN_IF_ABANDONED if (fDrawingManager->abandoned()) { return; }
+#define RETURN_FALSE_IF_ABANDONED if (fDrawingManager->abandoned()) { return false; }
+#define RETURN_NULL_IF_ABANDONED if (fDrawingManager->abandoned()) { return nullptr; }
class AutoCheckFlush {
public:
- AutoCheckFlush(GrContext* context) : fContext(context) { SkASSERT(context); }
- ~AutoCheckFlush() { fContext->flushIfNecessary(); }
+ AutoCheckFlush(GrDrawingManager* drawingManager) : fDrawingManager(drawingManager) {
+ SkASSERT(fDrawingManager);
+ }
+ ~AutoCheckFlush() { fDrawingManager->getContext()->flushIfNecessary(); }
private:
- GrContext* fContext;
+ GrDrawingManager* fDrawingManager;
};
// In MDB mode the reffing of the 'getLastDrawTarget' call's result allows in-progress
// drawTargets to be picked up and added to by drawContexts lower in the call
// stack. When this occurs with a closed drawTarget, a new one will be allocated
// when the drawContext attempts to use it (via getDrawTarget).
-GrDrawContext::GrDrawContext(GrContext* context,
+GrDrawContext::GrDrawContext(GrDrawingManager* drawingMgr,
GrRenderTarget* rt,
const SkSurfaceProps* surfaceProps)
- : fContext(context)
+ : fDrawingManager(drawingMgr)
, fRenderTarget(rt)
, fDrawTarget(SkSafeRef(rt->getLastDrawTarget()))
, fTextContext(nullptr)
SkDEBUGCODE(this->validate();)
if (!fDrawTarget || fDrawTarget->isClosed()) {
- fDrawTarget = fContext->newDrawTarget(fRenderTarget);
+ fDrawTarget = fDrawingManager->newDrawTarget(fRenderTarget);
fRenderTarget->setLastDrawTarget(fDrawTarget);
}
SkDEBUGCODE(this->validate();)
if (!fTextContext) {
- fTextContext = fContext->textContext(fSurfaceProps, fRenderTarget);
+ fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget);
}
fTextContext->drawText(this, fRenderTarget, clip, grPaint, skPaint, viewMatrix,
SkDEBUGCODE(this->validate();)
if (!fTextContext) {
- fTextContext = fContext->textContext(fSurfaceProps, fRenderTarget);
+ fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget);
}
fTextContext->drawPosText(this, fRenderTarget, clip, grPaint, skPaint, viewMatrix, text, byteLength,
SkDEBUGCODE(this->validate();)
if (!fTextContext) {
- fTextContext = fContext->textContext(fSurfaceProps, fRenderTarget);
+ fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget);
}
fTextContext->drawTextBlob(this, fRenderTarget,
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
- AutoCheckFlush acf(fContext);
+ AutoCheckFlush acf(fDrawingManager);
this->getDrawTarget()->discard(fRenderTarget);
}
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
- AutoCheckFlush acf(fContext);
+ AutoCheckFlush acf(fDrawingManager);
this->getDrawTarget()->clear(rect, color, canIgnoreRect, fRenderTarget);
}
return;
}
- AutoCheckFlush acf(fContext);
+ AutoCheckFlush acf(fDrawingManager);
GrPipelineBuilder pipelineBuilder(*paint, fRenderTarget, clip);
this->getDrawTarget()->drawNonAARect(pipelineBuilder,
return;
}
- AutoCheckFlush acf(fContext);
+ AutoCheckFlush acf(fDrawingManager);
GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
- AutoCheckFlush acf(fContext);
+ AutoCheckFlush acf(fDrawingManager);
GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
this->getDrawTarget()->drawNonAARect(pipelineBuilder,
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
- AutoCheckFlush acf(fContext);
+ AutoCheckFlush acf(fDrawingManager);
GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
this->getDrawTarget()->drawNonAARect(pipelineBuilder,
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
- AutoCheckFlush acf(fContext);
+ AutoCheckFlush acf(fDrawingManager);
GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
- AutoCheckFlush acf(fContext);
+ AutoCheckFlush acf(fDrawingManager);
GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
return;
}
- AutoCheckFlush acf(fContext);
+ AutoCheckFlush acf(fDrawingManager);
GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
GrColor color = paint.getColor();
return;
}
- AutoCheckFlush acf(fContext);
+ AutoCheckFlush acf(fDrawingManager);
GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
GrColor color = paint.getColor();
return;
}
- AutoCheckFlush acf(fContext);
+ AutoCheckFlush acf(fDrawingManager);
GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
GrColor color = paint.getColor();
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
- AutoCheckFlush acf(fContext);
+ AutoCheckFlush acf(fDrawingManager);
GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
this->getDrawTarget()->drawBatch(pipelineBuilder, batch);
// cache. This presents a potential hazard for buffered drawing. However,
// the writePixels that uploads to the scratch will perform a flush so we're
// OK.
- AutoCheckFlush acf(fContext);
+ AutoCheckFlush acf(fDrawingManager);
GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
if (!strokeInfo.isDashed()) {
const GrStrokeInfo* strokeInfoPtr = &strokeInfo;
// Try a 1st time without stroking the path and without allowing the SW renderer
- GrPathRenderer* pr = fContext->getPathRenderer(target, pipelineBuilder, viewMatrix, *pathPtr,
- *strokeInfoPtr, false, type);
+ GrPathRenderer* pr = fDrawingManager->getContext()->getPathRenderer(target, pipelineBuilder,
+ viewMatrix, *pathPtr,
+ *strokeInfoPtr, false,
+ type);
GrStrokeInfo dashlessStrokeInfo(strokeInfo, false);
if (nullptr == pr && strokeInfo.isDashed()) {
return;
}
strokeInfoPtr = &dashlessStrokeInfo;
- pr = fContext->getPathRenderer(target, pipelineBuilder, viewMatrix, *pathPtr, *strokeInfoPtr,
- false, type);
+ pr = fDrawingManager->getContext()->getPathRenderer(target, pipelineBuilder, viewMatrix,
+ *pathPtr, *strokeInfoPtr,
+ false, type);
}
if (nullptr == pr) {
}
// This time, allow SW renderer
- pr = fContext->getPathRenderer(target, pipelineBuilder, viewMatrix, *pathPtr, *strokeInfoPtr,
- true, type);
+ pr = fDrawingManager->getContext()->getPathRenderer(target, pipelineBuilder, viewMatrix,
+ *pathPtr, *strokeInfoPtr,
+ true, type);
}
if (nullptr == pr) {
GrPathRenderer::DrawPathArgs args;
args.fTarget = target;
- args.fResourceProvider = fContext->resourceProvider();
+ args.fResourceProvider = fDrawingManager->getContext()->resourceProvider();
args.fPipelineBuilder = pipelineBuilder;
args.fColor = color;
args.fViewMatrix = &viewMatrix;
--- /dev/null
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrDrawingManager_DEFINED
+#define GrDrawingManager_DEFINED
+
+#include "SkTDArray.h"
+
+class GrContext;
+class GrDrawContext;
+class GrTextContext;
+
+// Currently the DrawingManager creates a separate GrTextContext for each
+// combination of text drawing options (pixel geometry x DFT use)
+// and hands the appropriate one back given the DrawContext's request.
+//
+// It allocates a new GrDrawContext for each GrRenderTarget
+// but all of them still land in the same GrDrawTarget!
+//
+// In the future this class will allocate a new GrDrawContext for
+// each GrRenderTarget/GrDrawTarget and manage the DAG.
+class GrDrawingManager {
+public:
+ ~GrDrawingManager();
+
+ bool abandoned() const { return fAbandoned; }
+
+ GrDrawContext* drawContext(GrRenderTarget* rt, const SkSurfaceProps* surfaceProps);
+
+ GrTextContext* textContext(const SkSurfaceProps& props, GrRenderTarget* rt);
+
+ // The caller automatically gets a ref on the returned drawTarget. It must
+ // be balanced by an unref call.
+ GrDrawTarget* newDrawTarget(GrRenderTarget* rt);
+
+ GrContext* getContext() { return fContext; }
+
+private:
+ GrDrawingManager(GrContext* context)
+ : fContext(context)
+ , fAbandoned(false)
+ , fNVPRTextContext(nullptr) {
+ sk_bzero(fTextContexts, sizeof(fTextContexts));
+ }
+
+ void abandon();
+ void cleanup();
+ void reset();
+ void flush();
+
+ friend class GrContext; // for access to: ctor, abandon, reset & flush
+
+ static const int kNumPixelGeometries = 5; // The different pixel geometries
+ static const int kNumDFTOptions = 2; // DFT or no DFT
+
+ GrContext* fContext;
+
+ bool fAbandoned;
+ SkTDArray<GrDrawTarget*> fDrawTargets;
+
+ GrTextContext* fNVPRTextContext;
+ GrTextContext* fTextContexts[kNumPixelGeometries][kNumDFTOptions];
+};
+
+#endif
#include "GrBatchAtlas.h"
#include "GrBatchFontCache.h"
#include "GrContextOptions.h"
+#include "GrDrawingManager.h"
#include "GrGpuResourceCacheAccess.h"
#include "GrResourceCache.h"
#include "GrTextBlobCache.h"
// then disconnects. This would help prevent test writers from mixing using the returned
// GrDrawTarget and regular drawing. We could also assert or fail in GrContext drawing methods
// until ~GrTestTarget().
- SkAutoTUnref<GrDrawTarget> dt(fDrawingMgr.newDrawTarget(nullptr));
+ SkAutoTUnref<GrDrawTarget> dt(fDrawingManager->newDrawTarget(nullptr));
tar->init(this, dt);
}
// We delete these because we want to test the cache starting with zero resources. Also, none of
// these objects are required for any of tests that use this context. TODO: make stop allocating
// resources in the buffer pools.
- fDrawingMgr.abandon();
+ fDrawingManager->abandon();
}
fLegacyBitmap.setInfo(info);
fLegacyBitmap.setPixelRef(pr)->unref();
- fDrawContext.reset(fContext->drawContext(rt, &this->surfaceProps()));
+ fDrawContext.reset(this->context()->drawContext(rt, &this->surfaceProps()));
}
GrRenderTarget* SkGpuDevice::CreateRenderTarget(GrContext* context, SkSurface::Budgeted budgeted,
: SkSurface::kNo_Budgeted;
SkAutoTUnref<GrRenderTarget> newRT(CreateRenderTarget(
- fRenderTarget->getContext(), budgeted, this->imageInfo(), fRenderTarget->desc().fSampleCnt));
+ this->context(), budgeted, this->imageInfo(), fRenderTarget->desc().fSampleCnt));
if (nullptr == newRT) {
return;
SkPixelRef* pr = new SkGrPixelRef(fLegacyBitmap.info(), fRenderTarget);
fLegacyBitmap.setPixelRef(pr)->unref();
- fDrawContext.reset(fRenderTarget->getContext()->drawContext(fRenderTarget,
- &this->surfaceProps()));
+ fDrawContext.reset(this->context()->drawContext(fRenderTarget, &this->surfaceProps()));
}
///////////////////////////////////////////////////////////////////////////////
paint1.addColorFragmentProcessor(pmToUPM1);
- SkAutoTUnref<GrDrawContext> readDrawContext(context->drawContext(readTex->asRenderTarget()));
+ SkAutoTUnref<GrDrawContext> readDrawContext(
+ context->drawContext(readTex->asRenderTarget()));
if (!readDrawContext) {
failed = true;
break;
paint2.addColorFragmentProcessor(upmToPM);
- SkAutoTUnref<GrDrawContext> tempDrawContext(context->drawContext(tempTex->asRenderTarget()));
+ SkAutoTUnref<GrDrawContext> tempDrawContext(
+ context->drawContext(tempTex->asRenderTarget()));
if (!tempDrawContext) {
failed = true;
break;