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

Side by Side Diff: src/core/SkPaint.cpp

Issue 1683743005: Simple cleanups related to SkFixed. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Revert changes to src/core/SkScan_Hairline.cpp; causes one layout test to regress. 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 unified diff | Download patch
« no previous file with comments | « src/core/SkBitmapFilter.h ('k') | src/effects/gradients/SkTwoPointConicalGradient.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkPaint.h" 8 #include "SkPaint.h"
9 #include "SkAnnotation.h" 9 #include "SkAnnotation.h"
10 #include "SkAutoKern.h" 10 #include "SkAutoKern.h"
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 if (scale) { 918 if (scale) {
919 maxWidth /= scale; 919 maxWidth /= scale;
920 } 920 }
921 921
922 SkAutoGlyphCache autoCache(paint, nullptr, nullptr); 922 SkAutoGlyphCache autoCache(paint, nullptr, nullptr);
923 SkGlyphCache* cache = autoCache.getCache(); 923 SkGlyphCache* cache = autoCache.getCache();
924 924
925 GlyphCacheProc glyphCacheProc = paint.getGlyphCacheProc(false); 925 GlyphCacheProc glyphCacheProc = paint.getGlyphCacheProc(false);
926 const int xyIndex = paint.isVerticalText() ? 1 : 0; 926 const int xyIndex = paint.isVerticalText() ? 1 : 0;
927 // use 64bits for our accumulator, to avoid overflowing 16.16 927 // use 64bits for our accumulator, to avoid overflowing 16.16
928 Sk48Dot16 max = SkScalarToFixed(maxWidth); 928 Sk48Dot16 max = SkScalarTo48Dot16(maxWidth);
929 Sk48Dot16 width = 0; 929 Sk48Dot16 width = 0;
930 930
931 SkAutoKern autokern; 931 SkAutoKern autokern;
932 932
933 if (this->isDevKernText()) { 933 if (this->isDevKernText()) {
934 int rsb = 0; 934 int rsb = 0;
935 while (text < stop) { 935 while (text < stop) {
936 const char* curr = text; 936 const char* curr = text;
937 const SkGlyph& g = glyphCacheProc(cache, &text); 937 const SkGlyph& g = glyphCacheProc(cache, &text);
938 SkFixed x = SkAutoKern_AdjustF(rsb, g.fLsbDelta) + advance(g, xyInde x); 938 SkFixed x = SkAutoKern_AdjustF(rsb, g.fLsbDelta) + advance(g, xyInde x);
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
2431 } 2431 }
2432 2432
2433 uint32_t SkPaint::getHash() const { 2433 uint32_t SkPaint::getHash() const {
2434 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields, 2434 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields,
2435 // so fBitfields should be 10 pointers and 6 32-bit values from the start. 2435 // so fBitfields should be 10 pointers and 6 32-bit values from the start.
2436 static_assert(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 * size of(uint32_t), 2436 static_assert(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 * size of(uint32_t),
2437 "SkPaint_notPackedTightly"); 2437 "SkPaint_notPackedTightly");
2438 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), 2438 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this),
2439 offsetof(SkPaint, fBitfields) + sizeof(fBitfields )); 2439 offsetof(SkPaint, fBitfields) + sizeof(fBitfields ));
2440 } 2440 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapFilter.h ('k') | src/effects/gradients/SkTwoPointConicalGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698