Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "SkPicture.h" | 12 #include "SkPicture.h" |
| 13 | 13 |
| 14 class SkPictureBox { | 14 class SkPictureBox { |
| 15 public: | 15 public: |
| 16 SkPictureBox(const SkPicture* obj) : fObj(SkRef(obj)) {} | 16 SkPictureBox(const SkPicture* obj) : fObj(SkRef(obj)) {} |
| 17 SkPictureBox(const SkPictureBox& src) : fObj(SkRef(src.fObj)) {} | 17 SkPictureBox(const SkPictureBox& src) : fObj(SkRef(src.fObj)) {} |
|
mtklein
2014/08/07 21:25:20
Try removing this too? I don't think we need it.
reed1
2014/08/08 13:57:29
Done.
| |
| 18 ~SkPictureBox() { fObj->unref(); } | 18 ~SkPictureBox() { fObj->unref(); } |
| 19 | 19 |
| 20 SkPictureBox& operator=(const SkPictureBox& src) { | |
| 21 SkRefCnt_SafeAssign(fObj, src.fObj); | |
| 22 return *this; | |
| 23 } | |
| 24 | |
| 25 operator const SkPicture*() const { return fObj; } | 20 operator const SkPicture*() const { return fObj; } |
| 26 | 21 |
| 27 private: | 22 private: |
| 23 SkPictureBox& operator=(const SkPictureBox& src); | |
| 24 | |
| 28 const SkPicture* fObj; | 25 const SkPicture* fObj; |
| 29 }; | 26 }; |
| 30 | 27 |
| 31 namespace SkRecords { | 28 namespace SkRecords { |
| 32 | 29 |
| 33 // A list of all the types of canvas calls we can record. | 30 // A list of all the types of canvas calls we can record. |
| 34 // Each of these is reified into a struct below. | 31 // Each of these is reified into a struct below. |
| 35 // | 32 // |
| 36 // (We're using the macro-of-macro trick here to do several different things wit h the same list.) | 33 // (We're using the macro-of-macro trick here to do several different things wit h the same list.) |
| 37 // | 34 // |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 RECORD5(DrawBitmapRectToRect, Optional<SkPaint>, paint, | 228 RECORD5(DrawBitmapRectToRect, Optional<SkPaint>, paint, |
| 232 ImmutableBitmap, bitmap, | 229 ImmutableBitmap, bitmap, |
| 233 Optional<SkRect>, src, | 230 Optional<SkRect>, src, |
| 234 SkRect, dst, | 231 SkRect, dst, |
| 235 SkCanvas::DrawBitmapRectFlags, flags); | 232 SkCanvas::DrawBitmapRectFlags, flags); |
| 236 RECORD3(DrawDRRect, SkPaint, paint, SkRRect, outer, SkRRect, inner); | 233 RECORD3(DrawDRRect, SkPaint, paint, SkRRect, outer, SkRRect, inner); |
| 237 RECORD2(DrawOval, SkPaint, paint, SkRect, oval); | 234 RECORD2(DrawOval, SkPaint, paint, SkRect, oval); |
| 238 RECORD1(DrawPaint, SkPaint, paint); | 235 RECORD1(DrawPaint, SkPaint, paint); |
| 239 RECORD2(DrawPath, SkPaint, paint, SkPath, path); | 236 RECORD2(DrawPath, SkPaint, paint, SkPath, path); |
| 240 RECORD2(DrawPatch, SkPaint, paint, SkPatch, patch); | 237 RECORD2(DrawPatch, SkPaint, paint, SkPatch, patch); |
| 241 RECORD1(DrawPicture, SkPictureBox, picture); | 238 RECORD3(DrawPicture, Optional<SkPaint>, paint, SkPictureBox, picture, Optional<S kMatrix>, matrix); |
| 242 RECORD4(DrawPoints, SkPaint, paint, SkCanvas::PointMode, mode, size_t, count, Sk Point*, pts); | 239 RECORD4(DrawPoints, SkPaint, paint, SkCanvas::PointMode, mode, size_t, count, Sk Point*, pts); |
| 243 RECORD4(DrawPosText, SkPaint, paint, | 240 RECORD4(DrawPosText, SkPaint, paint, |
| 244 PODArray<char>, text, | 241 PODArray<char>, text, |
| 245 size_t, byteLength, | 242 size_t, byteLength, |
| 246 PODArray<SkPoint>, pos); | 243 PODArray<SkPoint>, pos); |
| 247 RECORD5(DrawPosTextH, SkPaint, paint, | 244 RECORD5(DrawPosTextH, SkPaint, paint, |
| 248 PODArray<char>, text, | 245 PODArray<char>, text, |
| 249 size_t, byteLength, | 246 size_t, byteLength, |
| 250 PODArray<SkScalar>, xpos, | 247 PODArray<SkScalar>, xpos, |
| 251 SkScalar, y); | 248 SkScalar, y); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 304 #undef RECORD0 | 301 #undef RECORD0 |
| 305 #undef RECORD1 | 302 #undef RECORD1 |
| 306 #undef RECORD2 | 303 #undef RECORD2 |
| 307 #undef RECORD3 | 304 #undef RECORD3 |
| 308 #undef RECORD4 | 305 #undef RECORD4 |
| 309 #undef RECORD5 | 306 #undef RECORD5 |
| 310 | 307 |
| 311 } // namespace SkRecords | 308 } // namespace SkRecords |
| 312 | 309 |
| 313 #endif//SkRecords_DEFINED | 310 #endif//SkRecords_DEFINED |
| OLD | NEW |