Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: src/core/SkDraw.cpp

Issue 111353003: deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPREC… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkClipStack.cpp ('k') | src/core/SkRTree.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDraw.cpp
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index ccab56ca62a3902c71c7600360864111d2b40600..d9bdd8e7b111d131f4f27afea542969bc2812878 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -399,8 +399,8 @@ static void bw_pt_rect_32_hair_proc(const PtProcRec& rec,
static void bw_pt_hair_proc(const PtProcRec& rec, const SkPoint devPts[],
int count, SkBlitter* blitter) {
for (int i = 0; i < count; i++) {
- int x = SkScalarFloor(devPts[i].fX);
- int y = SkScalarFloor(devPts[i].fY);
+ int x = SkScalarFloorToInt(devPts[i].fX);
+ int y = SkScalarFloorToInt(devPts[i].fY);
if (rec.fClip->contains(x, y)) {
blitter->blitH(x, y, 1);
}
@@ -1195,8 +1195,8 @@ void SkDraw::drawBitmapAsMask(const SkBitmap& bitmap,
SkASSERT(bitmap.config() == SkBitmap::kA8_Config);
if (just_translate(*fMatrix, bitmap)) {
- int ix = SkScalarRound(fMatrix->getTranslateX());
- int iy = SkScalarRound(fMatrix->getTranslateY());
+ int ix = SkScalarRoundToInt(fMatrix->getTranslateX());
+ int iy = SkScalarRoundToInt(fMatrix->getTranslateY());
SkAutoLockPixels alp(bitmap);
if (!bitmap.readyToDraw()) {
@@ -1318,8 +1318,8 @@ void SkDraw::drawBitmap(const SkBitmap& bitmap, const SkMatrix& prematrix,
if (fBounder && just_translate(matrix, bitmap)) {
SkIRect ir;
- int32_t ix = SkScalarRound(matrix.getTranslateX());
- int32_t iy = SkScalarRound(matrix.getTranslateY());
+ int32_t ix = SkScalarRoundToInt(matrix.getTranslateX());
+ int32_t iy = SkScalarRoundToInt(matrix.getTranslateY());
ir.set(ix, iy, ix + bitmap.width(), iy + bitmap.height());
if (!fBounder->doIRect(ir)) {
return;
@@ -1336,8 +1336,8 @@ void SkDraw::drawBitmap(const SkBitmap& bitmap, const SkMatrix& prematrix,
if (!bitmap.readyToDraw()) {
return;
}
- int ix = SkScalarRound(matrix.getTranslateX());
- int iy = SkScalarRound(matrix.getTranslateY());
+ int ix = SkScalarRoundToInt(matrix.getTranslateX());
+ int iy = SkScalarRoundToInt(matrix.getTranslateY());
if (clipHandlesSprite(*fRC, ix, iy, bitmap)) {
uint32_t storage[kBlitterStorageLongCount];
SkBlitter* blitter = SkBlitter::ChooseSprite(*fBitmap, paint, bitmap,
@@ -2741,16 +2741,16 @@ bool SkBounder::doHairline(const SkPoint& pt0, const SkPoint& pt1,
if (v0 > v1) {
SkTSwap<SkScalar>(v0, v1);
}
- r.fLeft = SkScalarFloor(v0);
- r.fRight = SkScalarCeil(v1);
+ r.fLeft = SkScalarFloorToInt(v0);
+ r.fRight = SkScalarCeilToInt(v1);
v0 = pt0.fY;
v1 = pt1.fY;
if (v0 > v1) {
SkTSwap<SkScalar>(v0, v1);
}
- r.fTop = SkScalarFloor(v0);
- r.fBottom = SkScalarCeil(v1);
+ r.fTop = SkScalarFloorToInt(v0);
+ r.fBottom = SkScalarCeilToInt(v1);
if (paint.isAntiAlias()) {
r.inset(-1, -1);
« no previous file with comments | « src/core/SkClipStack.cpp ('k') | src/core/SkRTree.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698