void SkDeferredCanvas::drawRect(const SkRect& rect, const SkPaint& paint) { if (fDeferredDrawing && isFullFrame(&rect, &paint) && isPaintOpaque(&paint)) { getDeferredDevice()->contentsCleared(); } drawingCanvas()->drawRect(rect, paint); }
void SkDeferredCanvas::drawPaint(const SkPaint& paint) { if (fDeferredDrawing && isFullFrame(NULL, &paint) && isPaintOpaque(paint)) { getDeferredDevice()->purgePending(); } drawingCanvas()->drawPaint(paint); }
void SkDeferredCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, const SkPaint* paint) { SkRect bitmapRect = SkRect::MakeXYWH(left, top, SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height())); if (fDeferredDrawing && isFullFrame(&bitmapRect, paint) && isPaintOpaque(paint, &bitmap)) { getDeferredDevice()->contentsCleared(); } drawingCanvas()->drawBitmap(bitmap, left, top, paint); flushIfNeeded(bitmap); }
void SkDeferredCanvas::drawBitmapRect(const SkBitmap& bitmap, const SkIRect* src, const SkRect& dst, const SkPaint* paint) { if (fDeferredDrawing && isFullFrame(&dst, paint) && isPaintOpaque(paint, &bitmap)) { getDeferredDevice()->contentsCleared(); } drawingCanvas()->drawBitmapRect(bitmap, src, dst, paint); flushIfNeeded(bitmap); }
void SkDeferredCanvas::drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint) { SkRect bitmapRect = SkRect::MakeXYWH(left, top, bitmap.width(), bitmap.height()); if (fDeferredDrawing && isFullFrame(&bitmapRect, paint) && isPaintOpaque(*paint, &bitmap)) { getDeferredDevice()->purgePending(); } drawingCanvas()->drawSprite(bitmap, left, top, paint); flushIfNeeded(bitmap); }