Ejemplo n.º 1
0
void SkRecorder::onDrawBitmapRect(const SkBitmap& bitmap,
                                  const SkRect* src,
                                  const SkRect& dst,
                                  const SkPaint* paint,
                                  SrcRectConstraint constraint) {
#ifdef WRAP_BITMAP_AS_IMAGE
    // TODO: need a way to support the flags for images...
    SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(bitmap));
    if (image) {
        this->onDrawImageRect(image, src, dst, paint);
    }
#else
    TRY_MINIRECORDER(drawBitmapRect, bitmap, src, dst, paint, constraint);
    if (kFast_SrcRectConstraint == constraint) {
        APPEND(DrawBitmapRectFast, this->copy(paint), bitmap, this->copy(src), dst);
        return;
    }
    SkASSERT(kStrict_SrcRectConstraint == constraint);
    APPEND(DrawBitmapRect, this->copy(paint), bitmap, this->copy(src), dst);
#endif
}
Ejemplo n.º 2
0
void SkRecorder::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
                                const SkPaint& paint) {
    TRY_MINIRECORDER(drawTextBlob, blob, x, y, paint);
    APPEND(DrawTextBlob, paint, blob, x, y);
}
Ejemplo n.º 3
0
void SkRecorder::onDrawPath(const SkPath& path, const SkPaint& paint) {
    TRY_MINIRECORDER(drawPath, path, paint);
    APPEND(DrawPath, paint, path);
}
Ejemplo n.º 4
0
void SkRecorder::onDrawRect(const SkRect& rect, const SkPaint& paint) {
    TRY_MINIRECORDER(drawRect, rect, paint);
    APPEND(DrawRect, paint, rect);
}