Added some assertions.

git-svn-id: http://skia.googlecode.com/svn/trunk@5184 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
keyar@chromium.org 2012-08-20 15:04:07 +00:00
parent c81686cd6e
commit bffacc01d6

View File

@ -70,6 +70,12 @@ void PictureRenderer::end() {
}
void PictureRenderer::resetState() {
SkASSERT(fCanvas.get() != NULL);
SkASSERT(fPicture != NULL);
if (NULL == fCanvas.get() || NULL == fPicture) {
return;
}
fCanvas->flush();
if (this->isUsingGpuDevice()) {
@ -186,6 +192,12 @@ void TiledPictureRenderer::drawTiles() {
}
void TiledPictureRenderer::resetState() {
SkASSERT(fCanvas.get() != NULL);
SkASSERT(fPicture != NULL);
if (NULL == fCanvas.get() || NULL == fPicture) {
return;
}
for (int i = 0; i < fTiles.count(); ++i) {
fTiles[i].fCanvas->flush();
}