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

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

Issue 619853005: add SkRect::joinNonEmptyArg for faster unioning (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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/GrBitmapTextContext.cpp ('k') | 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 2013 Google Inc. 2 * Copyright 2013 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 7
8 #include "GrDistanceFieldTextContext.h" 8 #include "GrDistanceFieldTextContext.h"
9 #include "GrAtlas.h" 9 #include "GrAtlas.h"
10 #include "GrDrawTarget.h" 10 #include "GrDrawTarget.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 SkFixed ty = SkIntToFixed(glyph->fAtlasLocation.fY + SK_DistanceFieldInset); 404 SkFixed ty = SkIntToFixed(glyph->fAtlasLocation.fY + SK_DistanceFieldInset);
405 SkFixed tw = SkIntToFixed(glyph->fBounds.width() - 2*SK_DistanceFieldInset); 405 SkFixed tw = SkIntToFixed(glyph->fBounds.width() - 2*SK_DistanceFieldInset);
406 SkFixed th = SkIntToFixed(glyph->fBounds.height() - 2*SK_DistanceFieldInset) ; 406 SkFixed th = SkIntToFixed(glyph->fBounds.height() - 2*SK_DistanceFieldInset) ;
407 407
408 SkRect r; 408 SkRect r;
409 r.fLeft = sx; 409 r.fLeft = sx;
410 r.fTop = sy; 410 r.fTop = sy;
411 r.fRight = sx + width; 411 r.fRight = sx + width;
412 r.fBottom = sy + height; 412 r.fBottom = sy + height;
413 413
414 fVertexBounds.growToInclude(r); 414 fVertexBounds.joinNonEmptyArg(r);
415 415
416 size_t vertSize = fUseLCDText ? (2 * sizeof(SkPoint)) 416 size_t vertSize = fUseLCDText ? (2 * sizeof(SkPoint))
417 : (2 * sizeof(SkPoint) + sizeof(GrColor)); 417 : (2 * sizeof(SkPoint) + sizeof(GrColor));
418 418
419 SkASSERT(vertSize == fDrawTarget->getDrawState().getVertexStride()); 419 SkASSERT(vertSize == fDrawTarget->getDrawState().getVertexStride());
420 420
421 SkPoint* positions = reinterpret_cast<SkPoint*>( 421 SkPoint* positions = reinterpret_cast<SkPoint*>(
422 reinterpret_cast<intptr_t>(fVertices) + vertSize * fCurrVertex); 422 reinterpret_cast<intptr_t>(fVertices) + vertSize * fCurrVertex);
423 positions->setRectFan(r.fLeft, r.fTop, r.fRight, r.fBottom, vertSize); 423 positions->setRectFan(r.fLeft, r.fTop, r.fRight, r.fBottom, vertSize);
424 424
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 SkScalarToFixed(x) - (glyph.fAdvanceX >> a lignShift), 668 SkScalarToFixed(x) - (glyph.fAdvanceX >> a lignShift),
669 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift), 669 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift),
670 fontScaler); 670 fontScaler);
671 } 671 }
672 pos += scalarsPerPosition; 672 pos += scalarsPerPosition;
673 } 673 }
674 } 674 }
675 675
676 this->finish(); 676 this->finish();
677 } 677 }
OLDNEW
« no previous file with comments | « src/gpu/GrBitmapTextContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698