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

Side by Side Diff: src/record/SkRecorder.h

Issue 248033002: Rearrange SkRecord public API to fit better with cc/resources/picture (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add forgetRecord() Created 6 years, 8 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 SkRecorder_DEFINED 8 #ifndef SkRecorder_DEFINED
9 #define SkRecorder_DEFINED 9 #define SkRecorder_DEFINED
10 10
(...skipping 10 matching lines...) Expand all
21 // are supported, and all of the readback methods on SkCanvas will probabl y fail or lie. 21 // are supported, and all of the readback methods on SkCanvas will probabl y fail or lie.
22 // 22 //
23 // read-write: all methods should behave with similar semantics to SkCanva s. 23 // read-write: all methods should behave with similar semantics to SkCanva s.
24 // 24 //
25 // Write-only averages 10-20% faster, but you can't sensibly inspect the can vas while recording. 25 // Write-only averages 10-20% faster, but you can't sensibly inspect the can vas while recording.
26 enum Mode { kWriteOnly_Mode, kReadWrite_Mode }; 26 enum Mode { kWriteOnly_Mode, kReadWrite_Mode };
27 27
28 // Does not take ownership of the SkRecord. 28 // Does not take ownership of the SkRecord.
29 SkRecorder(Mode mode, SkRecord*, int width, int height); 29 SkRecorder(Mode mode, SkRecord*, int width, int height);
30 30
31 // Make SkRecorder forget entirely about its SkRecord*; all calls to SkRecor der will fail.
32 void forgetRecord();
33
31 void clear(SkColor) SK_OVERRIDE; 34 void clear(SkColor) SK_OVERRIDE;
32 void drawPaint(const SkPaint& paint) SK_OVERRIDE; 35 void drawPaint(const SkPaint& paint) SK_OVERRIDE;
33 void drawPoints(PointMode mode, 36 void drawPoints(PointMode mode,
34 size_t count, 37 size_t count,
35 const SkPoint pts[], 38 const SkPoint pts[],
36 const SkPaint& paint) SK_OVERRIDE; 39 const SkPaint& paint) SK_OVERRIDE;
37 void drawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE; 40 void drawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE;
38 void drawOval(const SkRect& oval, const SkPaint&) SK_OVERRIDE; 41 void drawOval(const SkRect& oval, const SkPaint&) SK_OVERRIDE;
39 void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRIDE; 42 void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRIDE;
40 void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE; 43 void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 T* copy(const T*); 112 T* copy(const T*);
110 113
111 template <typename T> 114 template <typename T>
112 T* copy(const T[], unsigned count); 115 T* copy(const T[], unsigned count);
113 116
114 const Mode fMode; 117 const Mode fMode;
115 SkRecord* fRecord; 118 SkRecord* fRecord;
116 }; 119 };
117 120
118 #endif//SkRecorder_DEFINED 121 #endif//SkRecorder_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698