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: include/private/SkRecords.h

Issue 2255283002: Fast path translate() in SkCanvas and SkLiteDL. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: plumb translate() through to SkRecord too Created 4 years, 4 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 | « include/core/SkCanvas.h ('k') | src/core/SkCanvas.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 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
(...skipping 29 matching lines...) Expand all
40 // types polymorphically. (See SkRecord::Record::{visit,mutate} for an example. ) 40 // types polymorphically. (See SkRecord::Record::{visit,mutate} for an example. )
41 // 41 //
42 // Order doesn't technically matter here, but the compiler can generally generat e better code if 42 // Order doesn't technically matter here, but the compiler can generally generat e better code if
43 // you keep them semantically grouped, especially the Draws. It's also nice to leave NoOp at 0. 43 // you keep them semantically grouped, especially the Draws. It's also nice to leave NoOp at 0.
44 #define SK_RECORD_TYPES(M) \ 44 #define SK_RECORD_TYPES(M) \
45 M(NoOp) \ 45 M(NoOp) \
46 M(Restore) \ 46 M(Restore) \
47 M(Save) \ 47 M(Save) \
48 M(SaveLayer) \ 48 M(SaveLayer) \
49 M(SetMatrix) \ 49 M(SetMatrix) \
50 M(Translate) \
50 M(TranslateZ) \ 51 M(TranslateZ) \
51 M(Concat) \ 52 M(Concat) \
52 M(ClipPath) \ 53 M(ClipPath) \
53 M(ClipRRect) \ 54 M(ClipRRect) \
54 M(ClipRect) \ 55 M(ClipRect) \
55 M(ClipRegion) \ 56 M(ClipRegion) \
56 M(DrawDrawable) \ 57 M(DrawDrawable) \
57 M(DrawImage) \ 58 M(DrawImage) \
58 M(DrawImageLattice) \ 59 M(DrawImageLattice) \
59 M(DrawImageRect) \ 60 M(DrawImageRect) \
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 Optional<SkRect> bounds; 176 Optional<SkRect> bounds;
176 Optional<SkPaint> paint; 177 Optional<SkPaint> paint;
177 sk_sp<const SkImageFilter> backdrop; 178 sk_sp<const SkImageFilter> backdrop;
178 SkCanvas::SaveLayerFlags saveLayerFlags); 179 SkCanvas::SaveLayerFlags saveLayerFlags);
179 180
180 RECORD(SetMatrix, 0, 181 RECORD(SetMatrix, 0,
181 TypedMatrix matrix); 182 TypedMatrix matrix);
182 RECORD(Concat, 0, 183 RECORD(Concat, 0,
183 TypedMatrix matrix); 184 TypedMatrix matrix);
184 185
186 RECORD(Translate, 0,
187 SkScalar dx;
188 SkScalar dy);
185 RECORD(TranslateZ, 0, SkScalar z); 189 RECORD(TranslateZ, 0, SkScalar z);
186 190
187 struct RegionOpAndAA { 191 struct RegionOpAndAA {
188 RegionOpAndAA() {} 192 RegionOpAndAA() {}
189 RegionOpAndAA(SkRegion::Op op, bool aa) : op(op), aa(aa) {} 193 RegionOpAndAA(SkRegion::Op op, bool aa) : op(op), aa(aa) {}
190 SkRegion::Op op : 31; // This really only needs to be 3, but there's no win today to do so. 194 SkRegion::Op op : 31; // This really only needs to be 3, but there's no win today to do so.
191 unsigned aa : 1; // MSVC won't pack an enum with an bool, so we call t his an unsigned. 195 unsigned aa : 1; // MSVC won't pack an enum with an bool, so we call t his an unsigned.
192 }; 196 };
193 static_assert(sizeof(RegionOpAndAA) == 4, "RegionOpAndAASize"); 197 static_assert(sizeof(RegionOpAndAA) == 4, "RegionOpAndAASize");
194 198
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 int indexCount); 334 int indexCount);
331 RECORD(DrawAnnotation, 0, // TODO: kDraw_Tag, skia:5548 335 RECORD(DrawAnnotation, 0, // TODO: kDraw_Tag, skia:5548
332 SkRect rect; 336 SkRect rect;
333 SkString key; 337 SkString key;
334 sk_sp<SkData> value); 338 sk_sp<SkData> value);
335 #undef RECORD 339 #undef RECORD
336 340
337 } // namespace SkRecords 341 } // namespace SkRecords
338 342
339 #endif//SkRecords_DEFINED 343 #endif//SkRecords_DEFINED
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698