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

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

Issue 1779263003: Make sp variants for SkData (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/SkFontDescriptor.cpp ('k') | src/core/SkPicture.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 "SkAutoKern.h" 9 #include "SkAutoKern.h"
10 #include "SkChecksum.h" 10 #include "SkChecksum.h"
(...skipping 1925 matching lines...) Expand 10 before | Expand all | Expand 10 after
1936 SkSafeUnref(this->setRasterizer(buffer.readRasterizer())); 1936 SkSafeUnref(this->setRasterizer(buffer.readRasterizer()));
1937 SkSafeUnref(this->setLooper(buffer.readDrawLooper())); 1937 SkSafeUnref(this->setLooper(buffer.readDrawLooper()));
1938 SkSafeUnref(this->setImageFilter(buffer.readImageFilter())); 1938 SkSafeUnref(this->setImageFilter(buffer.readImageFilter()));
1939 1939
1940 if (buffer.isVersionLT(SkReadBuffer::kAnnotationsMovedToCanvas_Version)) { 1940 if (buffer.isVersionLT(SkReadBuffer::kAnnotationsMovedToCanvas_Version)) {
1941 // We used to store annotations here (string+skdata) if this bool wa s true 1941 // We used to store annotations here (string+skdata) if this bool wa s true
1942 if (buffer.readBool()) { 1942 if (buffer.readBool()) {
1943 // Annotations have moved to drawAnnotation, so we just drop thi s one on the floor. 1943 // Annotations have moved to drawAnnotation, so we just drop thi s one on the floor.
1944 SkString key; 1944 SkString key;
1945 buffer.readString(&key); 1945 buffer.readString(&key);
1946 SkSafeUnref(buffer.readByteArrayAsData()); 1946 (void)buffer.readByteArrayAsData();
1947 } 1947 }
1948 } 1948 }
1949 } else { 1949 } else {
1950 this->setPathEffect(nullptr); 1950 this->setPathEffect(nullptr);
1951 this->setShader(nullptr); 1951 this->setShader(nullptr);
1952 this->setXfermode(nullptr); 1952 this->setXfermode(nullptr);
1953 this->setMaskFilter(nullptr); 1953 this->setMaskFilter(nullptr);
1954 this->setColorFilter(nullptr); 1954 this->setColorFilter(nullptr);
1955 this->setRasterizer(nullptr); 1955 this->setRasterizer(nullptr);
1956 this->setLooper(nullptr); 1956 this->setLooper(nullptr);
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
2358 } 2358 }
2359 2359
2360 uint32_t SkPaint::getHash() const { 2360 uint32_t SkPaint::getHash() const {
2361 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields, 2361 // 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. 2362 // 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), 2363 static_assert(offsetof(SkPaint, fBitfields) == 9 * sizeof(void*) + 6 * sizeo f(uint32_t),
2364 "SkPaint_notPackedTightly"); 2364 "SkPaint_notPackedTightly");
2365 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this), 2365 return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(this),
2366 offsetof(SkPaint, fBitfields) + sizeof(fBitfields )); 2366 offsetof(SkPaint, fBitfields) + sizeof(fBitfields ));
2367 } 2367 }
OLDNEW
« no previous file with comments | « src/core/SkFontDescriptor.cpp ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698