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

Side by Side Diff: src/core/SkRecords.h

Issue 1176953002: move SkPath direction-as-computed into SkPathPriv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
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 SkRecords_DEFINED 8 #ifndef SkRecords_DEFINED
9 #define SkRecords_DEFINED 9 #define SkRecords_DEFINED
10 10
11 #include "SkCanvas.h" 11 #include "SkCanvas.h"
12 #include "SkDrawable.h" 12 #include "SkDrawable.h"
13 #include "SkPathPriv.h"
13 #include "SkPicture.h" 14 #include "SkPicture.h"
14 #include "SkTextBlob.h" 15 #include "SkTextBlob.h"
15 16
16 namespace SkRecords { 17 namespace SkRecords {
17 18
18 // A list of all the types of canvas calls we can record. 19 // A list of all the types of canvas calls we can record.
19 // Each of these is reified into a struct below. 20 // Each of these is reified into a struct below.
20 // 21 //
21 // (We're using the macro-of-macro trick here to do several different things wit h the same list.) 22 // (We're using the macro-of-macro trick here to do several different things wit h the same list.)
22 // 23 //
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 SkBitmap fBitmap; 209 SkBitmap fBitmap;
209 }; 210 };
210 211
211 // SkPath::getBounds() isn't thread safe unless we precache the bounds in a sing lethreaded context. 212 // SkPath::getBounds() isn't thread safe unless we precache the bounds in a sing lethreaded context.
212 // SkPath::cheapComputeDirection() is similar. 213 // SkPath::cheapComputeDirection() is similar.
213 // Recording is a convenient time to cache these, or we can delay it to between record and playback. 214 // Recording is a convenient time to cache these, or we can delay it to between record and playback.
214 struct PreCachedPath : public SkPath { 215 struct PreCachedPath : public SkPath {
215 PreCachedPath() {} 216 PreCachedPath() {}
216 explicit PreCachedPath(const SkPath& path) : SkPath(path) { 217 explicit PreCachedPath(const SkPath& path) : SkPath(path) {
217 this->updateBoundsCache(); 218 this->updateBoundsCache();
218 SkPath::Direction junk; 219 SkPathPriv::FirstDirection junk;
219 (void)this->cheapComputeDirection(&junk); 220 (void)SkPathPriv::CheapComputeFirstDirection(*this, &junk);
220 } 221 }
221 }; 222 };
222 223
223 // Like SkPath::getBounds(), SkMatrix::getType() isn't thread safe unless we pre cache it. 224 // Like SkPath::getBounds(), SkMatrix::getType() isn't thread safe unless we pre cache it.
224 // This may not cover all SkMatrices used by the picture (e.g. some could be hid ing in a shader). 225 // This may not cover all SkMatrices used by the picture (e.g. some could be hid ing in a shader).
225 struct TypedMatrix : public SkMatrix { 226 struct TypedMatrix : public SkMatrix {
226 TypedMatrix() {} 227 TypedMatrix() {}
227 explicit TypedMatrix(const SkMatrix& matrix) : SkMatrix(matrix) { 228 explicit TypedMatrix(const SkMatrix& matrix) : SkMatrix(matrix) {
228 (void)this->getType(); 229 (void)this->getType();
229 } 230 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 #undef RECORD0 359 #undef RECORD0
359 #undef RECORD1 360 #undef RECORD1
360 #undef RECORD2 361 #undef RECORD2
361 #undef RECORD3 362 #undef RECORD3
362 #undef RECORD4 363 #undef RECORD4
363 #undef RECORD5 364 #undef RECORD5
364 365
365 } // namespace SkRecords 366 } // namespace SkRecords
366 367
367 #endif//SkRecords_DEFINED 368 #endif//SkRecords_DEFINED
OLDNEW
« src/core/SkPathPriv.h ('K') | « src/core/SkPathPriv.h ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698