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

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

Issue 1135693003: Revert of Revert of stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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/SkGeometry.cpp ('k') | src/core/SkPathMeasure.cpp » ('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 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after
2306 2306
2307 if (fPaint.getPathEffect() == NULL && !has_thick_frame(fPaint)) { 2307 if (fPaint.getPathEffect() == NULL && !has_thick_frame(fPaint)) {
2308 applyStrokeAndPathEffects = false; 2308 applyStrokeAndPathEffects = false;
2309 } 2309 }
2310 2310
2311 // can't use our canonical size if we need to apply patheffects 2311 // can't use our canonical size if we need to apply patheffects
2312 if (fPaint.getPathEffect() == NULL) { 2312 if (fPaint.getPathEffect() == NULL) {
2313 fPaint.setTextSize(SkIntToScalar(SkPaint::kCanonicalTextSizeForPaths)); 2313 fPaint.setTextSize(SkIntToScalar(SkPaint::kCanonicalTextSizeForPaths));
2314 fScale = paint.getTextSize() / SkPaint::kCanonicalTextSizeForPaths; 2314 fScale = paint.getTextSize() / SkPaint::kCanonicalTextSizeForPaths;
2315 if (has_thick_frame(fPaint)) { 2315 if (has_thick_frame(fPaint)) {
2316 fPaint.setStrokeWidth(SkScalarDiv(fPaint.getStrokeWidth(), fScale)); 2316 fPaint.setStrokeWidth(fPaint.getStrokeWidth() / fScale);
2317 } 2317 }
2318 } else { 2318 } else {
2319 fScale = SK_Scalar1; 2319 fScale = SK_Scalar1;
2320 } 2320 }
2321 2321
2322 if (!applyStrokeAndPathEffects) { 2322 if (!applyStrokeAndPathEffects) {
2323 fPaint.setStyle(SkPaint::kFill_Style); 2323 fPaint.setStyle(SkPaint::kFill_Style);
2324 fPaint.setPathEffect(NULL); 2324 fPaint.setPathEffect(NULL);
2325 } 2325 }
2326 2326
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
2426 } 2426 }
2427 2427
2428 uint32_t SkPaint::getHash() const { 2428 uint32_t SkPaint::getHash() const {
2429 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields, 2429 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields,
2430 // so fBitfields should be 10 pointers and 6 32-bit values from the start. 2430 // so fBitfields should be 10 pointers and 6 32-bit values from the start.
2431 SK_COMPILE_ASSERT(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 * sizeof(uint32_t), 2431 SK_COMPILE_ASSERT(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 * sizeof(uint32_t),
2432 SkPaint_notPackedTightly); 2432 SkPaint_notPackedTightly);
2433 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), 2433 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this),
2434 offsetof(SkPaint, fBitfields) + sizeof(fBitfields )); 2434 offsetof(SkPaint, fBitfields) + sizeof(fBitfields ));
2435 } 2435 }
OLDNEW
« no previous file with comments | « src/core/SkGeometry.cpp ('k') | src/core/SkPathMeasure.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698