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

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

Issue 1776983002: pass cap to dash text (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
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 "SkAutoKern.h" 9 #include "SkAutoKern.h"
10 #include "SkChecksum.h" 10 #include "SkChecksum.h"
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 } 1349 }
1350 1350
1351 if (paint.isDevKernText()) { 1351 if (paint.isDevKernText()) {
1352 flags |= SkScalerContext::kDevKernText_Flag; 1352 flags |= SkScalerContext::kDevKernText_Flag;
1353 } 1353 }
1354 1354
1355 if (style != SkPaint::kFill_Style && strokeWidth > 0) { 1355 if (style != SkPaint::kFill_Style && strokeWidth > 0) {
1356 rec->fFrameWidth = strokeWidth; 1356 rec->fFrameWidth = strokeWidth;
1357 rec->fMiterLimit = paint.getStrokeMiter(); 1357 rec->fMiterLimit = paint.getStrokeMiter();
1358 rec->fStrokeJoin = SkToU8(paint.getStrokeJoin()); 1358 rec->fStrokeJoin = SkToU8(paint.getStrokeJoin());
1359 rec->fStrokeCap = SkToU8(paint.getStrokeCap());
1359 1360
1360 if (style == SkPaint::kStrokeAndFill_Style) { 1361 if (style == SkPaint::kStrokeAndFill_Style) {
1361 flags |= SkScalerContext::kFrameAndFill_Flag; 1362 flags |= SkScalerContext::kFrameAndFill_Flag;
1362 } 1363 }
1363 } else { 1364 } else {
1364 rec->fFrameWidth = 0; 1365 rec->fFrameWidth = 0;
1365 rec->fMiterLimit = 0; 1366 rec->fMiterLimit = 0;
1366 rec->fStrokeJoin = 0; 1367 rec->fStrokeJoin = 0;
1368 rec->fStrokeCap = 0;
1367 } 1369 }
1368 1370
1369 rec->fMaskFormat = SkToU8(compute_mask_format(paint)); 1371 rec->fMaskFormat = SkToU8(compute_mask_format(paint));
1370 1372
1371 if (SkMask::kLCD16_Format == rec->fMaskFormat) { 1373 if (SkMask::kLCD16_Format == rec->fMaskFormat) {
1372 if (too_big_for_lcd(*rec, checkPost2x2)) { 1374 if (too_big_for_lcd(*rec, checkPost2x2)) {
1373 rec->fMaskFormat = SkMask::kA8_Format; 1375 rec->fMaskFormat = SkMask::kA8_Format;
1374 flags |= SkScalerContext::kGenA8FromLCD_Flag; 1376 flags |= SkScalerContext::kGenA8FromLCD_Flag;
1375 } else { 1377 } else {
1376 SkPixelGeometry geometry = surfaceProps 1378 SkPixelGeometry geometry = surfaceProps
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
2358 } 2360 }
2359 2361
2360 uint32_t SkPaint::getHash() const { 2362 uint32_t SkPaint::getHash() const {
2361 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields, 2363 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields,
2362 // so fBitfields should be 10 pointers and 6 32-bit values from the start. 2364 // so fBitfields should be 10 pointers and 6 32-bit values from the start.
2363 static_assert(offsetof(SkPaint, fBitfields) == 9 * sizeof(void*) + 6 * sizeo f(uint32_t), 2365 static_assert(offsetof(SkPaint, fBitfields) == 9 * sizeof(void*) + 6 * sizeo f(uint32_t),
2364 "SkPaint_notPackedTightly"); 2366 "SkPaint_notPackedTightly");
2365 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), 2367 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this),
2366 offsetof(SkPaint, fBitfields) + sizeof(fBitfields )); 2368 offsetof(SkPaint, fBitfields) + sizeof(fBitfields ));
2367 } 2369 }
OLDNEW
« no previous file with comments | « gm/dashing.cpp ('k') | src/core/SkScalerContext.h » ('j') | src/core/SkScalerContext.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698