OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |