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
This commit is contained in:
parent
01c412e40a
commit
7ef849d45a
@ -337,8 +337,9 @@ static bool bitmapIsTooBig(const SkBitmap& bm) {
|
|||||||
return bm.width() > maxSize || bm.height() > maxSize;
|
return bm.width() > maxSize || bm.height() > maxSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
SkShader* CreateBitmapShader(const SkBitmap& src, SkShader::TileMode tmx,
|
SkShader* SkCreateBitmapShader(const SkBitmap& src, SkShader::TileMode tmx,
|
||||||
SkShader::TileMode tmy, const SkMatrix* localMatrix, SkTBlitterAllocator* allocator) {
|
SkShader::TileMode tmy, const SkMatrix* localMatrix,
|
||||||
|
SkTBlitterAllocator* allocator) {
|
||||||
SkShader* shader;
|
SkShader* shader;
|
||||||
SkColor color;
|
SkColor color;
|
||||||
if (src.isNull() || bitmapIsTooBig(src)) {
|
if (src.isNull() || bitmapIsTooBig(src)) {
|
||||||
@ -466,7 +467,7 @@ bool SkBitmapProcShader::asFragmentProcessor(GrContext* context, const SkPaint&
|
|||||||
"Couldn't convert bitmap to texture.");
|
"Couldn't convert bitmap to texture.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
*paintColor = (kAlpha_8_SkColorType == fRawBitmap.colorType()) ?
|
*paintColor = (kAlpha_8_SkColorType == fRawBitmap.colorType()) ?
|
||||||
SkColor2GrColor(paint.getColor()) :
|
SkColor2GrColor(paint.getColor()) :
|
||||||
SkColor2GrColorJustAlpha(paint.getColor());
|
SkColor2GrColorJustAlpha(paint.getColor());
|
||||||
@ -480,7 +481,7 @@ bool SkBitmapProcShader::asFragmentProcessor(GrContext* context, const SkPaint&
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix*, GrColor*,
|
bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix*, GrColor*,
|
||||||
GrFragmentProcessor**) const {
|
GrFragmentProcessor**) const {
|
||||||
|
@ -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
|
// If alloc is non-NULL, it will be used to allocate the returned SkShader, and MUST outlive
|
||||||
// the SkShader.
|
// the SkShader.
|
||||||
SkShader* CreateBitmapShader(const SkBitmap& src, SkShader::TileMode, SkShader::TileMode,
|
SkShader* SkCreateBitmapShader(const SkBitmap& src, SkShader::TileMode, SkShader::TileMode,
|
||||||
const SkMatrix* localMatrix, SkTBlitterAllocator* alloc);
|
const SkMatrix* localMatrix, SkTBlitterAllocator* alloc);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -77,9 +77,9 @@ public:
|
|||||||
SkAutoBitmapShaderInstall(const SkBitmap& src, const SkPaint& paint,
|
SkAutoBitmapShaderInstall(const SkBitmap& src, const SkPaint& paint,
|
||||||
const SkMatrix* localMatrix = NULL)
|
const SkMatrix* localMatrix = NULL)
|
||||||
: fPaint(paint) /* makes a copy of the paint */ {
|
: fPaint(paint) /* makes a copy of the paint */ {
|
||||||
fPaint.setShader(CreateBitmapShader(src, SkShader::kClamp_TileMode,
|
fPaint.setShader(SkCreateBitmapShader(src, SkShader::kClamp_TileMode,
|
||||||
SkShader::kClamp_TileMode,
|
SkShader::kClamp_TileMode,
|
||||||
localMatrix, &fAllocator));
|
localMatrix, &fAllocator));
|
||||||
// we deliberately left the shader with an owner-count of 2
|
// we deliberately left the shader with an owner-count of 2
|
||||||
SkASSERT(2 == fPaint.getShader()->getRefCnt());
|
SkASSERT(2 == fPaint.getShader()->getRefCnt());
|
||||||
}
|
}
|
||||||
@ -595,7 +595,7 @@ void SkDraw::drawPoints(SkCanvas::PointMode mode, size_t count,
|
|||||||
if (newPaint.getStrokeCap() == SkPaint::kRound_Cap) {
|
if (newPaint.getStrokeCap() == SkPaint::kRound_Cap) {
|
||||||
SkPath path;
|
SkPath path;
|
||||||
SkMatrix preMatrix;
|
SkMatrix preMatrix;
|
||||||
|
|
||||||
path.addCircle(0, 0, radius);
|
path.addCircle(0, 0, radius);
|
||||||
for (size_t i = 0; i < count; i++) {
|
for (size_t i = 0; i < count; i++) {
|
||||||
preMatrix.setTranslate(pts[i].fX, pts[i].fY);
|
preMatrix.setTranslate(pts[i].fX, pts[i].fY);
|
||||||
@ -1955,7 +1955,7 @@ void SkDraw::drawTextOnPath(const char text[], size_t byteLength,
|
|||||||
if (iterPath) {
|
if (iterPath) {
|
||||||
SkPath tmp;
|
SkPath tmp;
|
||||||
SkMatrix m(scaledMatrix);
|
SkMatrix m(scaledMatrix);
|
||||||
|
|
||||||
tmp.setIsVolatile(true);
|
tmp.setIsVolatile(true);
|
||||||
m.postTranslate(xpos + hOffset, 0);
|
m.postTranslate(xpos + hOffset, 0);
|
||||||
if (matrix) {
|
if (matrix) {
|
||||||
|
@ -242,7 +242,7 @@ SkShader* SkShader::CreateColorShader(SkColor color) {
|
|||||||
|
|
||||||
SkShader* SkShader::CreateBitmapShader(const SkBitmap& src, TileMode tmx, TileMode tmy,
|
SkShader* SkShader::CreateBitmapShader(const SkBitmap& src, TileMode tmx, TileMode tmy,
|
||||||
const SkMatrix* localMatrix) {
|
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,
|
SkShader* SkShader::CreatePictureShader(SkPicture* src, TileMode tmx, TileMode tmy,
|
||||||
|
Loading…
Reference in New Issue
Block a user