Unblock DEPS roll by remove SkAutoTUnref from GrDrawContext

BUG=skia:

Review URL: https://codereview.chromium.org/1156103006
This commit is contained in:
robertphillips 2015-05-26 14:37:00 -07:00 committed by Commit bot
parent b97e909151
commit 4b195e5d8f
3 changed files with 8 additions and 3 deletions

View File

@ -226,6 +226,7 @@ private:
friend class GrContext; // for ctor
GrDrawContext(GrContext* context, GrDrawTarget* drawTarget);
~GrDrawContext() override;
// Sets the paint. Returns true on success; false on failure.
bool prepareToDraw(GrPipelineBuilder*,
@ -245,8 +246,8 @@ private:
const SkPath&,
const GrStrokeInfo&);
GrContext* fContext; // owning context -> no ref
SkAutoTUnref<GrDrawTarget> fDrawTarget;
GrContext* fContext; // owning context -> no ref
GrDrawTarget* fDrawTarget;
};
#endif

View File

@ -78,7 +78,7 @@ GrContext::DrawingMgr::~DrawingMgr() {
void GrContext::DrawingMgr::abandon() {
SkSafeSetNull(fDrawTarget);
fDrawContext->fDrawTarget.reset(NULL);
SkSafeSetNull(fDrawContext->fDrawTarget);
SkSafeSetNull(fDrawContext);
}

View File

@ -33,6 +33,10 @@ GrDrawContext::GrDrawContext(GrContext* context, GrDrawTarget* drawTarget)
, fDrawTarget(SkRef(drawTarget)) {
}
GrDrawContext::~GrDrawContext() {
SkSafeUnref(fDrawTarget);
}
void GrDrawContext::copySurface(GrRenderTarget* dst, GrSurface* src,
const SkIRect& srcRect, const SkIPoint& dstPoint) {
if (!this->prepareToDraw(dst)) {