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

Side by Side Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1242033002: All batches do their own pipeline compare (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add quick accept to pipeline compare Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrBatch.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "GrAtlasTextContext.h" 7 #include "GrAtlasTextContext.h"
8 8
9 #include "GrBatch.h" 9 #include "GrBatch.h"
10 #include "GrBatchFontCache.h" 10 #include "GrBatchFontCache.h"
(...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after
1866 flushInfo->fVertexOffset += kVerticesPerGlyph * flushInfo->fGlyphsToFlus h; 1866 flushInfo->fVertexOffset += kVerticesPerGlyph * flushInfo->fGlyphsToFlus h;
1867 flushInfo->fGlyphsToFlush = 0; 1867 flushInfo->fGlyphsToFlush = 0;
1868 } 1868 }
1869 1869
1870 GrColor color() const { return fBatch.fColor; } 1870 GrColor color() const { return fBatch.fColor; }
1871 const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; } 1871 const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; }
1872 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; } 1872 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
1873 int numGlyphs() const { return fBatch.fNumGlyphs; } 1873 int numGlyphs() const { return fBatch.fNumGlyphs; }
1874 1874
1875 bool onCombineIfPossible(GrBatch* t) override { 1875 bool onCombineIfPossible(GrBatch* t) override {
1876 if (!this->pipeline()->isEqual(*t->pipeline())) {
1877 return false;
1878 }
1879
1876 BitmapTextBatch* that = t->cast<BitmapTextBatch>(); 1880 BitmapTextBatch* that = t->cast<BitmapTextBatch>();
1877 1881
1878 if (fUseDistanceFields != that->fUseDistanceFields) { 1882 if (fUseDistanceFields != that->fUseDistanceFields) {
1879 return false; 1883 return false;
1880 } 1884 }
1881 1885
1882 if (!fUseDistanceFields) { 1886 if (!fUseDistanceFields) {
1883 // Bitmap Text 1887 // Bitmap Text
1884 if (fMaskFormat != that->fMaskFormat) { 1888 if (fMaskFormat != that->fMaskFormat) {
1885 return false; 1889 return false;
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text, 2269 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text,
2266 static_cast<size_t>(textLen), 0, 0, noClip)); 2270 static_cast<size_t>(textLen), 0, 0, noClip));
2267 2271
2268 SkScalar transX = static_cast<SkScalar>(random->nextU()); 2272 SkScalar transX = static_cast<SkScalar>(random->nextU());
2269 SkScalar transY = static_cast<SkScalar>(random->nextU()); 2273 SkScalar transY = static_cast<SkScalar>(random->nextU());
2270 const GrAtlasTextContext::BitmapTextBlob::Run::SubRunInfo& info = blob->fRun s[0].fSubRunInfo[0]; 2274 const GrAtlasTextContext::BitmapTextBlob::Run::SubRunInfo& info = blob->fRun s[0].fSubRunInfo[0];
2271 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint); 2275 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint);
2272 } 2276 }
2273 2277
2274 #endif 2278 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698