diff options
author | 2012-08-17 13:43:08 +0000 | |
---|---|---|
committer | 2012-08-17 13:43:08 +0000 | |
commit | 1b3ce47c7b6c14c84d7aaee249b33f9d3b473050 (patch) | |
tree | 6c0b2e2992c18968b928148b68d9e2fbe5528c88 | |
parent | 72f3dca451f4739e20be0b4b198813677339205c (diff) |
Fix clear records in IODB
Review URL: http://codereview.appspot.com/6465061/
git-svn-id: http://skia.googlecode.com/svn/trunk@5148 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/gpu/GrInOrderDrawBuffer.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp index a0585f7a6c..e562300dd9 100644 --- a/src/gpu/GrInOrderDrawBuffer.cpp +++ b/src/gpu/GrInOrderDrawBuffer.cpp @@ -467,20 +467,22 @@ void GrInOrderDrawBuffer::clear(const GrIRect* rect, GrColor color, GrRenderTarget* renderTarget) { GrIRect r; + if (NULL == renderTarget) { + renderTarget = this->drawState()->getRenderTarget(); + GrAssert(NULL != renderTarget); + } if (NULL == rect) { // We could do something smart and remove previous draws and clears to // the current render target. If we get that smart we have to make sure // those draws aren't read before this clear (render-to-texture). - r.setLTRB(0, 0, - this->getDrawState().getRenderTarget()->width(), - this->getDrawState().getRenderTarget()->height()); + r.setLTRB(0, 0, renderTarget->width(), renderTarget->height()); rect = &r; } Clear* clr = this->recordClear(); clr->fColor = color; clr->fRect = *rect; clr->fRenderTarget = renderTarget; - GrSafeRef(clr->fRenderTarget); + renderTarget->ref(); } void GrInOrderDrawBuffer::reset() { |