Adding a flush method to SkCanvas
BUG=http://code.google.com/p/skia/issues/detail?id=467 REVIEW=http://codereview.appspot.com/5600044/ TEST=gm uses the new code path on all its test cases git-svn-id: http://skia.googlecode.com/svn/trunk@3102 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
9aed114505
commit
bf6c1e4aff
@ -287,9 +287,7 @@ static ErrorBitfield generate_image(GM* gm, const ConfigData& gRec,
|
||||
}
|
||||
SkAutoUnref canvasUnref(canvas);
|
||||
invokeGM(gm, canvas);
|
||||
if (deferred) {
|
||||
canvas->getDevice()->accessBitmap(false); // trigger a flush
|
||||
}
|
||||
canvas->flush();
|
||||
} else { // GPU
|
||||
if (NULL == context) {
|
||||
return ERROR_NO_GPU_CONTEXT;
|
||||
|
@ -61,6 +61,11 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Trigger the immediate execution of all pending draw operations.
|
||||
*/
|
||||
void flush();
|
||||
|
||||
/**
|
||||
* Return the width/height of the underlying device. The current drawable
|
||||
* area may be small (due to clipping or saveLayer). For a canvas with
|
||||
|
@ -470,6 +470,13 @@ SkDrawFilter* SkCanvas::setDrawFilter(SkDrawFilter* filter) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void SkCanvas::flush() {
|
||||
SkDevice* device = this->getDevice();
|
||||
if (device) {
|
||||
device->flush();
|
||||
}
|
||||
}
|
||||
|
||||
SkISize SkCanvas::getDeviceSize() const {
|
||||
SkDevice* d = this->getDevice();
|
||||
return d ? SkISize::Make(d->width(), d->height()) : SkISize::Make(0, 0);
|
||||
|
@ -535,6 +535,7 @@ void SkDeferredCanvas::DeferredDevice::flushPending()
|
||||
void SkDeferredCanvas::DeferredDevice::flush()
|
||||
{
|
||||
flushPending();
|
||||
fImmediateCanvas->flush();
|
||||
}
|
||||
|
||||
void SkDeferredCanvas::DeferredDevice::flushContext()
|
||||
|
Loading…
Reference in New Issue
Block a user