Be sure to call context->flush() before we swapbuffers, otherwise we might miss

some deferred drawing calls (esp. text). SkGpuCanvas was doing this for us, so
now we have to do it explicitly.



git-svn-id: http://skia.googlecode.com/svn/trunk@1813 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
mike@reedtribe.org 2011-07-07 01:10:34 +00:00
parent 2ef12d4bb5
commit 6757a1a2bb

View File

@ -591,13 +591,17 @@ void SampleWindow::draw(SkCanvas* canvas) {
} }
// do this last // do this last
if (fGrContext && (fCanvasType != kGPU_CanvasType)) { if (fGrContext) {
fGrContext->setRenderTarget(fGrRenderTarget); // in case we have queued drawing calls
// need to send the bits to the (gpu) window fGrContext->flush();
const SkBitmap& bm = this->getBitmap(); if (fCanvasType != kGPU_CanvasType) {
fGrContext->writePixels(0, 0, bm.width(), bm.height(), // need to send the raster bits to the (gpu) window
kRGBA_8888_GrPixelConfig, bm.getPixels(), fGrContext->setRenderTarget(fGrRenderTarget);
bm.rowBytes()); const SkBitmap& bm = this->getBitmap();
fGrContext->writePixels(0, 0, bm.width(), bm.height(),
kRGBA_8888_GrPixelConfig, bm.getPixels(),
bm.rowBytes());
}
} }
presentGL(); presentGL();
} }