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

Unified Diff: src/core/SkDraw.cpp

Issue 1772463002: use Make instead of Create to return a shared shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: partial update of skia call-sites Created 4 years, 9 months 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
Index: src/core/SkDraw.cpp
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index efb19e2ec9da89b38b0c0bb35fcf490607a4f50c..31d53cf8d8cf5aa94c9aa069108002d4378a332d 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -81,9 +81,10 @@ public:
SkAutoBitmapShaderInstall(const SkBitmap& src, const SkPaint& paint,
const SkMatrix* localMatrix = nullptr)
: fPaint(paint) /* makes a copy of the paint */ {
- fPaint.setShader(SkCreateBitmapShader(src, SkShader::kClamp_TileMode,
- SkShader::kClamp_TileMode,
- localMatrix, &fAllocator));
+ fPaint.setShader(SkMakeBitmapShader(src, SkShader::kClamp_TileMode,
+ SkShader::kClamp_TileMode,
+ localMatrix, &fAllocator));
+ fPaint.getShader()->ref();
// we deliberately left the shader with an owner-count of 2
SkASSERT(2 == fPaint.getShader()->getRefCnt());
}
@@ -1676,7 +1677,7 @@ void SkDraw::drawPosText(const char text[], size_t byteLength,
#endif
///////////////////////////////////////////////////////////////////////////////
-
+#if 0
static SkScan::HairRCProc ChooseHairProc(bool doAntiAlias) {
return doAntiAlias ? SkScan::AntiHairLine : SkScan::HairLine;
}
@@ -1693,6 +1694,7 @@ static bool texture_to_matrix(const VertState& state, const SkPoint verts[],
dst[2] = verts[state.f2];
return matrix->setPolyToPoly(src, dst, 3);
}
+#endif
class SkTriColorShader : public SkShader {
public:
@@ -1817,7 +1819,7 @@ void SkTriColorShader::toString(SkString* str) const {
str->append(")");
}
#endif
-
+#if 0
f(malita) 2016/03/08 15:50:35 ?
void SkDraw::drawVertices(SkCanvas::VertexMode vmode, int count,
const SkPoint vertices[], const SkPoint textures[],
const SkColor colors[], SkXfermode* xmode,
@@ -1946,6 +1948,7 @@ void SkDraw::drawVertices(SkCanvas::VertexMode vmode, int count,
}
}
}
+#endif
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698