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

Side by Side Diff: src/core/SkMiniRecorder.cpp

Issue 2197243003: Replace old SkRecords RefBox with sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: builds 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/private/SkRecords.h ('k') | src/core/SkRecordDraw.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 2015 Google Inc. 2 * Copyright 2015 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 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkTLazy.h" 9 #include "SkTLazy.h"
10 #include "SkMiniRecorder.h" 10 #include "SkMiniRecorder.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 bool SkMiniRecorder::drawRect(const SkRect& rect, const SkPaint& paint) { 73 bool SkMiniRecorder::drawRect(const SkRect& rect, const SkPaint& paint) {
74 TRY_TO_STORE(DrawRect, paint, rect); 74 TRY_TO_STORE(DrawRect, paint, rect);
75 } 75 }
76 76
77 bool SkMiniRecorder::drawPath(const SkPath& path, const SkPaint& paint) { 77 bool SkMiniRecorder::drawPath(const SkPath& path, const SkPaint& paint) {
78 TRY_TO_STORE(DrawPath, paint, path); 78 TRY_TO_STORE(DrawPath, paint, path);
79 } 79 }
80 80
81 bool SkMiniRecorder::drawTextBlob(const SkTextBlob* b, SkScalar x, SkScalar y, c onst SkPaint& p) { 81 bool SkMiniRecorder::drawTextBlob(const SkTextBlob* b, SkScalar x, SkScalar y, c onst SkPaint& p) {
82 TRY_TO_STORE(DrawTextBlob, p, b, x, y); 82 TRY_TO_STORE(DrawTextBlob, p, sk_ref_sp(b), x, y);
83 } 83 }
84 #undef TRY_TO_STORE 84 #undef TRY_TO_STORE
85 85
86 86
87 sk_sp<SkPicture> SkMiniRecorder::detachAsPicture(const SkRect& cull) { 87 sk_sp<SkPicture> SkMiniRecorder::detachAsPicture(const SkRect& cull) {
88 #define CASE(Type) \ 88 #define CASE(Type) \
89 case State::k##Type: \ 89 case State::k##Type: \
90 fState = State::kEmpty; \ 90 fState = State::kEmpty; \
91 return sk_make_sp<SkMiniPicture<Type>>(cull, reinterpret_cast<Type*>(fBu ffer.get())) 91 return sk_make_sp<SkMiniPicture<Type>>(cull, reinterpret_cast<Type*>(fBu ffer.get()))
92 92
(...skipping 24 matching lines...) Expand all
117 117
118 switch (fState) { 118 switch (fState) {
119 case State::kEmpty: return; 119 case State::kEmpty: return;
120 CASE(DrawPath); 120 CASE(DrawPath);
121 CASE(DrawRect); 121 CASE(DrawRect);
122 CASE(DrawTextBlob); 122 CASE(DrawTextBlob);
123 } 123 }
124 SkASSERT(false); 124 SkASSERT(false);
125 #undef CASE 125 #undef CASE
126 } 126 }
OLDNEW
« no previous file with comments | « include/private/SkRecords.h ('k') | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698