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

Unified Diff: src/gpu/batches/GrAtlasTextBatch.cpp

Issue 1483103003: Make onPrepareDraws const (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: merge Created 5 years, 1 month 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/gpu/batches/GrAtlasTextBatch.h ('k') | src/gpu/batches/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAtlasTextBatch.cpp
diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp
index ac5ec118c363b032e79d8b3d966d41f16d491a56..fa34036af6e6c1614c62442e1b283d70734332d6 100644
--- a/src/gpu/batches/GrAtlasTextBatch.cpp
+++ b/src/gpu/batches/GrAtlasTextBatch.cpp
@@ -131,7 +131,7 @@ inline void GrAtlasTextBatch::regenBlob(Target* target, FlushInfo* flushInfo, Bl
SkTypeface** typeface, GrFontScaler** scaler,
const SkDescriptor** desc, const GrGeometryProcessor* gp,
int glyphCount, size_t vertexStride,
- GrColor color, SkScalar transX, SkScalar transY) {
+ GrColor color, SkScalar transX, SkScalar transY) const {
static_assert(!regenGlyphs || regenTexCoords, "must regenTexCoords along regenGlyphs");
GrBatchTextStrike* strike = nullptr;
if (regenTexCoords) {
@@ -297,7 +297,7 @@ enum RegenMask {
#define REGEN_ARGS target, &flushInfo, blob, &run, &info, &cache, &typeface, &scaler, &desc, gp, \
glyphCount, vertexStride, args.fColor, args.fTransX, args.fTransY
-void GrAtlasTextBatch::onPrepareDraws(Target* target) {
+void GrAtlasTextBatch::onPrepareDraws(Target* target) const {
// if we have RGB, then we won't have any SkShaders so no need to use a localmatrix.
// TODO actually only invert if we don't have RGBA
SkMatrix localMatrix;
@@ -363,7 +363,7 @@ void GrAtlasTextBatch::onPrepareDraws(Target* target) {
SkTypeface* typeface = nullptr;
for (int i = 0; i < fGeoCount; i++) {
- Geometry& args = fGeoData[i];
+ const Geometry& args = fGeoData[i];
Blob* blob = args.fBlob;
Run& run = blob->fRuns[args.fRun];
TextInfo& info = run.fSubRunInfo[args.fSubRun];
@@ -434,7 +434,7 @@ void GrAtlasTextBatch::onPrepareDraws(Target* target) {
this->flush(target, &flushInfo);
}
-void GrAtlasTextBatch::flush(GrVertexBatch::Target* target, FlushInfo* flushInfo) {
+void GrAtlasTextBatch::flush(GrVertexBatch::Target* target, FlushInfo* flushInfo) const {
GrVertices vertices;
int maxGlyphsPerDraw = flushInfo->fIndexBuffer->maxQuads();
vertices.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuffer,
@@ -518,7 +518,7 @@ bool GrAtlasTextBatch::onCombineIfPossible(GrBatch* t, const GrCaps& caps) {
// TODO trying to figure out why lcd is so whack
GrGeometryProcessor* GrAtlasTextBatch::setupDfProcessor(const SkMatrix& viewMatrix,
SkColor filteredColor,
- GrColor color, GrTexture* texture) {
+ GrColor color, GrTexture* texture) const {
GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kBilerp_FilterMode);
bool isLCD = this->isLCD();
// set up any flags
« no previous file with comments | « src/gpu/batches/GrAtlasTextBatch.h ('k') | src/gpu/batches/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698