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

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

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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/SkMultiPictureDraw.cpp ('k') | src/core/SkPathRef.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 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1504 static SkScalar gPaintGamma = SK_ScalarMin; 1504 static SkScalar gPaintGamma = SK_ScalarMin;
1505 static SkScalar gDeviceGamma = SK_ScalarMin; 1505 static SkScalar gDeviceGamma = SK_ScalarMin;
1506 /** 1506 /**
1507 * The caller must hold the gMaskGammaCacheMutex and continue to hold it until 1507 * The caller must hold the gMaskGammaCacheMutex and continue to hold it until
1508 * the returned SkMaskGamma pointer is refed or forgotten. 1508 * the returned SkMaskGamma pointer is refed or forgotten.
1509 */ 1509 */
1510 static const SkMaskGamma& cachedMaskGamma(SkScalar contrast, SkScalar paintGamma , SkScalar deviceGamma) { 1510 static const SkMaskGamma& cachedMaskGamma(SkScalar contrast, SkScalar paintGamma , SkScalar deviceGamma) {
1511 gMaskGammaCacheMutex.assertHeld(); 1511 gMaskGammaCacheMutex.assertHeld();
1512 if (0 == contrast && SK_Scalar1 == paintGamma && SK_Scalar1 == deviceGamma) { 1512 if (0 == contrast && SK_Scalar1 == paintGamma && SK_Scalar1 == deviceGamma) {
1513 if (NULL == gLinearMaskGamma) { 1513 if (NULL == gLinearMaskGamma) {
1514 gLinearMaskGamma = SkNEW(SkMaskGamma); 1514 gLinearMaskGamma = new SkMaskGamma;
1515 } 1515 }
1516 return *gLinearMaskGamma; 1516 return *gLinearMaskGamma;
1517 } 1517 }
1518 if (gContrast != contrast || gPaintGamma != paintGamma || gDeviceGamma != de viceGamma) { 1518 if (gContrast != contrast || gPaintGamma != paintGamma || gDeviceGamma != de viceGamma) {
1519 SkSafeUnref(gMaskGamma); 1519 SkSafeUnref(gMaskGamma);
1520 gMaskGamma = SkNEW_ARGS(SkMaskGamma, (contrast, paintGamma, deviceGamma) ); 1520 gMaskGamma = new SkMaskGamma(contrast, paintGamma, deviceGamma);
1521 gContrast = contrast; 1521 gContrast = contrast;
1522 gPaintGamma = paintGamma; 1522 gPaintGamma = paintGamma;
1523 gDeviceGamma = deviceGamma; 1523 gDeviceGamma = deviceGamma;
1524 } 1524 }
1525 return *gMaskGamma; 1525 return *gMaskGamma;
1526 } 1526 }
1527 1527
1528 /*static*/ void SkPaint::Term() { 1528 /*static*/ void SkPaint::Term() {
1529 SkAutoMutexAcquire ama(gMaskGammaCacheMutex); 1529 SkAutoMutexAcquire ama(gMaskGammaCacheMutex);
1530 1530
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
2427 } 2427 }
2428 2428
2429 uint32_t SkPaint::getHash() const { 2429 uint32_t SkPaint::getHash() const {
2430 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields, 2430 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields,
2431 // so fBitfields should be 10 pointers and 6 32-bit values from the start. 2431 // so fBitfields should be 10 pointers and 6 32-bit values from the start.
2432 static_assert(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 * size of(uint32_t), 2432 static_assert(offsetof(SkPaint, fBitfields) == 10 * sizeof(void*) + 6 * size of(uint32_t),
2433 "SkPaint_notPackedTightly"); 2433 "SkPaint_notPackedTightly");
2434 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), 2434 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this),
2435 offsetof(SkPaint, fBitfields) + sizeof(fBitfields )); 2435 offsetof(SkPaint, fBitfields) + sizeof(fBitfields ));
2436 } 2436 }
OLDNEW
« no previous file with comments | « src/core/SkMultiPictureDraw.cpp ('k') | src/core/SkPathRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698