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

Side by Side Diff: include/core/SkPath.h

Issue 1372103003: Make SkPath fFirstDirection atomic to fix tsan. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: WS fix Created 5 years, 2 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 | « no previous file | src/core/SkPath.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 #ifndef SkPath_DEFINED 8 #ifndef SkPath_DEFINED
9 #define SkPath_DEFINED 9 #define SkPath_DEFINED
10 10
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 kFillType_SerializationShift = 8, // requires 8 bits 931 kFillType_SerializationShift = 8, // requires 8 bits
932 // low-8-bits are version 932 // low-8-bits are version
933 }; 933 };
934 934
935 enum SerializationVersions { 935 enum SerializationVersions {
936 kPathPrivFirstDirection_Version = 1, 936 kPathPrivFirstDirection_Version = 1,
937 937
938 kCurrent_Version = 1 938 kCurrent_Version = 1
939 }; 939 };
940 940
941 SkAutoTUnref<SkPathRef> fPathRef; 941 SkAutoTUnref<SkPathRef> fPathRef;
942 942
943 int fLastMoveToIndex; 943 int fLastMoveToIndex;
944 uint8_t fFillType; 944 uint8_t fFillType;
945 mutable uint8_t fConvexity; 945 mutable uint8_t fConvexity;
946 mutable uint8_t fFirstDirection; // SkPathPriv::FirstDirection 946 mutable SkAtomic<uint8_t> fFirstDirection; // SkPathPriv::FirstDirection
947 mutable SkBool8 fIsVolatile; 947 mutable SkBool8 fIsVolatile;
948 948
949 /** Resets all fields other than fPathRef to their initial 'empty' values. 949 /** Resets all fields other than fPathRef to their initial 'empty' values.
950 * Assumes the caller has already emptied fPathRef. 950 * Assumes the caller has already emptied fPathRef.
951 * On Android increments fGenerationID without reseting it. 951 * On Android increments fGenerationID without reseting it.
952 */ 952 */
953 void resetFields(); 953 void resetFields();
954 954
955 /** Sets all fields other than fPathRef to the values in 'that'. 955 /** Sets all fields other than fPathRef to the values in 'that'.
956 * Assumes the caller has already set fPathRef. 956 * Assumes the caller has already set fPathRef.
957 * Doesn't change fGenerationID or fSourcePath on Android. 957 * Doesn't change fGenerationID or fSourcePath on Android.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 void setPt(int index, SkScalar x, SkScalar y); 1002 void setPt(int index, SkScalar x, SkScalar y);
1003 1003
1004 friend class SkAutoPathBoundsUpdate; 1004 friend class SkAutoPathBoundsUpdate;
1005 friend class SkAutoDisableOvalCheck; 1005 friend class SkAutoDisableOvalCheck;
1006 friend class SkAutoDisableDirectionCheck; 1006 friend class SkAutoDisableDirectionCheck;
1007 friend class SkBench_AddPathTest; // perf test reversePathTo 1007 friend class SkBench_AddPathTest; // perf test reversePathTo
1008 friend class PathTest_Private; // unit test reversePathTo 1008 friend class PathTest_Private; // unit test reversePathTo
1009 }; 1009 };
1010 1010
1011 #endif 1011 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698