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

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

Issue 1821103004: Revert of Revert[2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (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
« no previous file with comments | « src/core/SkModeColorFilter.cpp ('k') | src/core/SkReadBuffer.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 "SkAutoKern.h" 9 #include "SkAutoKern.h"
10 #include "SkChecksum.h" 10 #include "SkChecksum.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 Sk##Field* SkPaint::set##Field(Sk##Field* f) { \ 368 Sk##Field* SkPaint::set##Field(Sk##Field* f) { \
369 this->f##Field.reset(SkSafeRef(f)); \ 369 this->f##Field.reset(SkSafeRef(f)); \
370 return f; \ 370 return f; \
371 } 371 }
372 SET_PTR(Typeface) 372 SET_PTR(Typeface)
373 #ifdef SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR 373 #ifdef SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR
374 SET_PTR(Rasterizer) 374 SET_PTR(Rasterizer)
375 #endif 375 #endif
376 SET_PTR(ImageFilter) 376 SET_PTR(ImageFilter)
377 SET_PTR(Shader) 377 SET_PTR(Shader)
378 #ifdef SK_SUPPORT_LEGACY_COLORFILTER_PTR
379 SET_PTR(ColorFilter) 378 SET_PTR(ColorFilter)
380 #endif
381 SET_PTR(Xfermode) 379 SET_PTR(Xfermode)
382 #ifdef SK_SUPPORT_LEGACY_PATHEFFECT_PTR 380 #ifdef SK_SUPPORT_LEGACY_PATHEFFECT_PTR
383 SET_PTR(PathEffect) 381 SET_PTR(PathEffect)
384 #endif 382 #endif
385 SET_PTR(MaskFilter) 383 SET_PTR(MaskFilter)
386 #undef SET_PTR 384 #undef SET_PTR
387 385
388 #ifdef SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR 386 #ifdef SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR
389 SkDrawLooper* SkPaint::setLooper(SkDrawLooper* looper) { 387 SkDrawLooper* SkPaint::setLooper(SkDrawLooper* looper) {
390 fLooper.reset(SkSafeRef(looper)); 388 fLooper.reset(SkSafeRef(looper));
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1935 this->setTypeface(buffer.readTypeface()); 1933 this->setTypeface(buffer.readTypeface());
1936 } else { 1934 } else {
1937 this->setTypeface(nullptr); 1935 this->setTypeface(nullptr);
1938 } 1936 }
1939 1937
1940 if (flatFlags & kHasEffects_FlatFlag) { 1938 if (flatFlags & kHasEffects_FlatFlag) {
1941 this->setPathEffect(buffer.readPathEffect()); 1939 this->setPathEffect(buffer.readPathEffect());
1942 this->setShader(buffer.readShader()); 1940 this->setShader(buffer.readShader());
1943 SkSafeUnref(this->setXfermode(buffer.readXfermode())); 1941 SkSafeUnref(this->setXfermode(buffer.readXfermode()));
1944 SkSafeUnref(this->setMaskFilter(buffer.readMaskFilter())); 1942 SkSafeUnref(this->setMaskFilter(buffer.readMaskFilter()));
1945 this->setColorFilter(buffer.readColorFilter()); 1943 SkSafeUnref(this->setColorFilter(buffer.readColorFilter()));
1946 this->setRasterizer(buffer.readRasterizer()); 1944 this->setRasterizer(buffer.readRasterizer());
1947 this->setLooper(buffer.readDrawLooper()); 1945 this->setLooper(buffer.readDrawLooper());
1948 SkSafeUnref(this->setImageFilter(buffer.readImageFilter())); 1946 SkSafeUnref(this->setImageFilter(buffer.readImageFilter()));
1949 1947
1950 if (buffer.isVersionLT(SkReadBuffer::kAnnotationsMovedToCanvas_Version)) { 1948 if (buffer.isVersionLT(SkReadBuffer::kAnnotationsMovedToCanvas_Version)) {
1951 // We used to store annotations here (string+skdata) if this bool wa s true 1949 // We used to store annotations here (string+skdata) if this bool wa s true
1952 if (buffer.readBool()) { 1950 if (buffer.readBool()) {
1953 // Annotations have moved to drawAnnotation, so we just drop thi s one on the floor. 1951 // Annotations have moved to drawAnnotation, so we just drop thi s one on the floor.
1954 SkString key; 1952 SkString key;
1955 buffer.readString(&key); 1953 buffer.readString(&key);
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
2368 } 2366 }
2369 2367
2370 uint32_t SkPaint::getHash() const { 2368 uint32_t SkPaint::getHash() const {
2371 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields, 2369 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields,
2372 // so fBitfields should be 10 pointers and 6 32-bit values from the start. 2370 // so fBitfields should be 10 pointers and 6 32-bit values from the start.
2373 static_assert(offsetof(SkPaint, fBitfields) == 9 * sizeof(void*) + 6 * sizeo f(uint32_t), 2371 static_assert(offsetof(SkPaint, fBitfields) == 9 * sizeof(void*) + 6 * sizeo f(uint32_t),
2374 "SkPaint_notPackedTightly"); 2372 "SkPaint_notPackedTightly");
2375 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), 2373 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this),
2376 offsetof(SkPaint, fBitfields) + sizeof(fBitfields )); 2374 offsetof(SkPaint, fBitfields) + sizeof(fBitfields ));
2377 } 2375 }
OLDNEW
« no previous file with comments | « src/core/SkModeColorFilter.cpp ('k') | src/core/SkReadBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698