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

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

Issue 1088903009: Remove unnecessary viewmatrix compare in GrAtlasTextContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | no next file » | 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 "GrAtlas.h" 9 #include "GrAtlas.h"
10 #include "GrBatch.h" 10 #include "GrBatch.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } 270 }
271 271
272 // Similarly, we only cache one version for each style 272 // Similarly, we only cache one version for each style
273 if (blob.fKey.fStyle != SkPaint::kFill_Style && 273 if (blob.fKey.fStyle != SkPaint::kFill_Style &&
274 (blob.fStrokeInfo.fFrameWidth != paint.getStrokeWidth() || 274 (blob.fStrokeInfo.fFrameWidth != paint.getStrokeWidth() ||
275 blob.fStrokeInfo.fMiterLimit != paint.getStrokeMiter() || 275 blob.fStrokeInfo.fMiterLimit != paint.getStrokeMiter() ||
276 blob.fStrokeInfo.fJoin != paint.getStrokeJoin())) { 276 blob.fStrokeInfo.fJoin != paint.getStrokeJoin())) {
277 return true; 277 return true;
278 } 278 }
279 279
280 // Identical viewmatrices and we can reuse in all cases
281 if (blob.fViewMatrix.cheapEqualTo(viewMatrix) && x == blob.fX && y == blob.f Y) {
282 return false;
283 }
284
285 // Mixed blobs must be regenerated. We could probably figure out a way to d o integer scrolls 280 // Mixed blobs must be regenerated. We could probably figure out a way to d o integer scrolls
286 // for mixed blobs if this becomes an issue. 281 // for mixed blobs if this becomes an issue.
287 if (blob.hasBitmap() && blob.hasDistanceField()) { 282 if (blob.hasBitmap() && blob.hasDistanceField()) {
283 // Identical viewmatrices and we can reuse in all cases
284 if (blob.fViewMatrix.cheapEqualTo(viewMatrix) && x == blob.fX && y == bl ob.fY) {
285 return false;
286 }
288 return true; 287 return true;
289 } 288 }
290 289
291 if (blob.hasBitmap()) { 290 if (blob.hasBitmap()) {
292 if (blob.fViewMatrix.getScaleX() != viewMatrix.getScaleX() || 291 if (blob.fViewMatrix.getScaleX() != viewMatrix.getScaleX() ||
293 blob.fViewMatrix.getScaleY() != viewMatrix.getScaleY() || 292 blob.fViewMatrix.getScaleY() != viewMatrix.getScaleY() ||
294 blob.fViewMatrix.getSkewX() != viewMatrix.getSkewX() || 293 blob.fViewMatrix.getSkewX() != viewMatrix.getSkewX() ||
295 blob.fViewMatrix.getSkewY() != viewMatrix.getSkewY()) { 294 blob.fViewMatrix.getSkewY() != viewMatrix.getSkewY()) {
296 return true; 295 return true;
297 } 296 }
(...skipping 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after
2164 pipelineBuilder.setFromPaint(grPaint, rt, clip); 2163 pipelineBuilder.setFromPaint(grPaint, rt, clip);
2165 2164
2166 GrColor color = grPaint.getColor(); 2165 GrColor color = grPaint.getColor();
2167 for (int run = 0; run < cacheBlob->fRunCount; run++) { 2166 for (int run = 0; run < cacheBlob->fRunCount; run++) {
2168 this->flushRun(target, &pipelineBuilder, cacheBlob, run, color, 0, 0, sk Paint); 2167 this->flushRun(target, &pipelineBuilder, cacheBlob, run, color, 0, 0, sk Paint);
2169 } 2168 }
2170 2169
2171 // Now flush big glyphs 2170 // Now flush big glyphs
2172 this->flushBigGlyphs(cacheBlob, rt, grPaint, clip, 0, 0); 2171 this->flushBigGlyphs(cacheBlob, rt, grPaint, clip, 0, 0);
2173 } 2172 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698