aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-11-24 09:11:45 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-24 09:11:45 -0800
commit7ef849d45a4de02697697ea213bfae7c215a0c38 (patch)
treeb38a749d8dcecf168da6b0bf9d5fab3df9807efd
parent01c412e40ac4caa8df073b5235e22deb6f380b2b (diff)
Add Sk prefix to CreateBitmapShader.
It's neither static nor namespaced, so we should probably prefix it. BUG=skia: Review URL: https://codereview.chromium.org/754083002
-rw-r--r--src/core/SkBitmapProcShader.cpp9
-rw-r--r--src/core/SkBitmapProcShader.h4
-rw-r--r--src/core/SkDraw.cpp10
-rw-r--r--src/core/SkShader.cpp2
4 files changed, 13 insertions, 12 deletions
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index a9798b8e24..1a451fd591 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -337,8 +337,9 @@ static bool bitmapIsTooBig(const SkBitmap& bm) {
return bm.width() > maxSize || bm.height() > maxSize;
}
-SkShader* CreateBitmapShader(const SkBitmap& src, SkShader::TileMode tmx,
- SkShader::TileMode tmy, const SkMatrix* localMatrix, SkTBlitterAllocator* allocator) {
+SkShader* SkCreateBitmapShader(const SkBitmap& src, SkShader::TileMode tmx,
+ SkShader::TileMode tmy, const SkMatrix* localMatrix,
+ SkTBlitterAllocator* allocator) {
SkShader* shader;
SkColor color;
if (src.isNull() || bitmapIsTooBig(src)) {
@@ -466,7 +467,7 @@ bool SkBitmapProcShader::asFragmentProcessor(GrContext* context, const SkPaint&
"Couldn't convert bitmap to texture.");
return false;
}
-
+
*paintColor = (kAlpha_8_SkColorType == fRawBitmap.colorType()) ?
SkColor2GrColor(paint.getColor()) :
SkColor2GrColorJustAlpha(paint.getColor());
@@ -480,7 +481,7 @@ bool SkBitmapProcShader::asFragmentProcessor(GrContext* context, const SkPaint&
return true;
}
-#else
+#else
bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix*, GrColor*,
GrFragmentProcessor**) const {
diff --git a/src/core/SkBitmapProcShader.h b/src/core/SkBitmapProcShader.h
index cd52d9954e..17bb83bf56 100644
--- a/src/core/SkBitmapProcShader.h
+++ b/src/core/SkBitmapProcShader.h
@@ -78,7 +78,7 @@ typedef SkSmallAllocator<3, 1024> SkTBlitterAllocator;
// If alloc is non-NULL, it will be used to allocate the returned SkShader, and MUST outlive
// the SkShader.
-SkShader* CreateBitmapShader(const SkBitmap& src, SkShader::TileMode, SkShader::TileMode,
- const SkMatrix* localMatrix, SkTBlitterAllocator* alloc);
+SkShader* SkCreateBitmapShader(const SkBitmap& src, SkShader::TileMode, SkShader::TileMode,
+ const SkMatrix* localMatrix, SkTBlitterAllocator* alloc);
#endif
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 7ccd258ba8..61ab35df45 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -77,9 +77,9 @@ public:
SkAutoBitmapShaderInstall(const SkBitmap& src, const SkPaint& paint,
const SkMatrix* localMatrix = NULL)
: fPaint(paint) /* makes a copy of the paint */ {
- fPaint.setShader(CreateBitmapShader(src, SkShader::kClamp_TileMode,
- SkShader::kClamp_TileMode,
- localMatrix, &fAllocator));
+ fPaint.setShader(SkCreateBitmapShader(src, SkShader::kClamp_TileMode,
+ SkShader::kClamp_TileMode,
+ localMatrix, &fAllocator));
// we deliberately left the shader with an owner-count of 2
SkASSERT(2 == fPaint.getShader()->getRefCnt());
}
@@ -595,7 +595,7 @@ void SkDraw::drawPoints(SkCanvas::PointMode mode, size_t count,
if (newPaint.getStrokeCap() == SkPaint::kRound_Cap) {
SkPath path;
SkMatrix preMatrix;
-
+
path.addCircle(0, 0, radius);
for (size_t i = 0; i < count; i++) {
preMatrix.setTranslate(pts[i].fX, pts[i].fY);
@@ -1955,7 +1955,7 @@ void SkDraw::drawTextOnPath(const char text[], size_t byteLength,
if (iterPath) {
SkPath tmp;
SkMatrix m(scaledMatrix);
-
+
tmp.setIsVolatile(true);
m.postTranslate(xpos + hOffset, 0);
if (matrix) {
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp
index d8e4085160..df615bda5a 100644
--- a/src/core/SkShader.cpp
+++ b/src/core/SkShader.cpp
@@ -242,7 +242,7 @@ SkShader* SkShader::CreateColorShader(SkColor color) {
SkShader* SkShader::CreateBitmapShader(const SkBitmap& src, TileMode tmx, TileMode tmy,
const SkMatrix* localMatrix) {
- return ::CreateBitmapShader(src, tmx, tmy, localMatrix, NULL);
+ return SkCreateBitmapShader(src, tmx, tmy, localMatrix, NULL);
}
SkShader* SkShader::CreatePictureShader(SkPicture* src, TileMode tmx, TileMode tmy,