#endif
static SkDScalar SkDScalar_setMul(SkScalar a, SkScalar b) {
- return (SkDScalar)a * b;
+ return (SkDScalar) ((SkDScalar) a * b);
}
static void computeOuterProduct(SkScalar op[4],
return SkDScalar_toScalar(ddot(ax, ay, bx, by));
}
-bool SkSetPoly3To3(SkMatrix* matrix, const SkPoint src[3], const SkPoint dst[3]) {
+bool SkSetPoly3To3_A(SkMatrix* matrix, const SkPoint src[3], const SkPoint dst[3]) {
const SkPoint& srcAve = src[0];
const SkPoint& dstAve = dst[0];
}
static SkDScalar SkDScalar_setMul(SkScalar a, SkScalar b) {
- return (SkDScalar)a * b;
+ return (SkDScalar) ((SkDScalar) a * b);
}
static void computeOuterProduct(SkMatrix* matrix,
SkDScalar_setMul(ay, by));
}
-bool SkSetPoly3To3(SkMatrix* matrix, const SkPoint src[3], const SkPoint dst[3]) {
+bool SkSetPoly3To3_D(SkMatrix* matrix, const SkPoint src[3], const SkPoint dst[3]) {
const SkPoint& srcAve = src[0];
const SkPoint& dstAve = dst[0];
SkRect srcRect(rect);
scale_rect(&srcRect, 1.0f / scaleFactorX, 1.0f / scaleFactorY);
srcRect.roundOut();
- scale_rect(&srcRect, scaleFactorX, scaleFactorY);
+ scale_rect(&srcRect, static_cast<float>(scaleFactorX),
+ static_cast<float>(scaleFactorY));
this->setClip(srcRect);
const GrTextureDesc desc = {
const GrTextureDesc desc = {
kRenderTarget_GrTextureFlagBit,
- rect.width(),
- rect.height(),
+ SkScalarCeilToInt(rect.width()),
+ SkScalarCeilToInt(rect.height()),
kRGBA_8888_PM_GrPixelConfig,
0 // samples
};
SkImageFilter* filter = paint.getImageFilter();
if (NULL != filter) {
GrTexture* filteredTexture = filter_texture(fContext, texture, filter,
- GrRect::MakeWH(w, h));
+ GrRect::MakeWH(SkIntToScalar(w), SkIntToScalar(h)));
if (filteredTexture) {
grPaint.setTexture(kBitmapTextureIdx, filteredTexture);
texture = filteredTexture;
SkImageFilter* filter = paint.getImageFilter();
if (NULL != filter) {
- GrRect rect = GrRect::MakeWH(devTex->width(), devTex->height());
+ GrRect rect = GrRect::MakeWH(SkIntToScalar(devTex->width()),
+ SkIntToScalar(devTex->height()));
GrTexture* filteredTexture = filter_texture(fContext, devTex, filter,
rect);
if (filteredTexture) {
SkAutoCachedTexture act(this, src, sampler, &texture);
result->setConfig(src.config(), src.width(), src.height());
- GrRect rect = GrRect::MakeWH(src.width(), src.height());
+ GrRect rect = GrRect::MakeWH(SkIntToScalar(src.width()),
+ SkIntToScalar(src.height()));
GrTexture* resultTexture = filter_texture(fContext, texture, filter, rect);
if (resultTexture) {
result->setPixelRef(new SkGrTexturePixelRef(resultTexture))->unref();
// we have to clip to the content area; we've already applied the
// initial transform, so just clip to the device size.
if (fPageSize != fContentSize) {
- SkRect r = SkRect::MakeWH(this->width(), this->height());
+ SkRect r = SkRect::MakeWH(SkIntToScalar(this->width()),
+ SkIntToScalar(this->height()));
emit_clip(NULL, &r, &data);
}