OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkSurface_Base.h" | 8 #include "SkSurface_Base.h" |
9 #include "SkImagePriv.h" | 9 #include "SkImagePriv.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 void SkSurface::notifyContentWillChange(ContentChangeMode mode) { | 158 void SkSurface::notifyContentWillChange(ContentChangeMode mode) { |
159 asSB(this)->aboutToDraw(mode); | 159 asSB(this)->aboutToDraw(mode); |
160 } | 160 } |
161 | 161 |
162 SkCanvas* SkSurface::getCanvas() { | 162 SkCanvas* SkSurface::getCanvas() { |
163 return asSB(this)->getCachedCanvas(); | 163 return asSB(this)->getCachedCanvas(); |
164 } | 164 } |
165 | 165 |
166 SkImage* SkSurface::newImageSnapshot(Budgeted budgeted) { | 166 SkImage* SkSurface::newImageSnapshot(Budgeted budgeted) { |
167 SkImage* image = asSB(this)->getCachedImage(budgeted); | 167 // the caller will call unref() to balance this |
168 SkSafeRef(image); // the caller will call unref() to balance this | 168 return asSB(this)->refCachedImage(budgeted, kNo_ForceUnique); |
169 return image; | 169 } |
| 170 |
| 171 SkImage* SkSurface::newImageSnapshot(Budgeted budgeted, ForceUnique unique) { |
| 172 // the caller will call unref() to balance this |
| 173 return asSB(this)->refCachedImage(budgeted, unique); |
170 } | 174 } |
171 | 175 |
172 SkSurface* SkSurface::newSurface(const SkImageInfo& info) { | 176 SkSurface* SkSurface::newSurface(const SkImageInfo& info) { |
173 return asSB(this)->onNewSurface(info); | 177 return asSB(this)->onNewSurface(info); |
174 } | 178 } |
175 | 179 |
176 void SkSurface::draw(SkCanvas* canvas, SkScalar x, SkScalar y, | 180 void SkSurface::draw(SkCanvas* canvas, SkScalar x, SkScalar y, |
177 const SkPaint* paint) { | 181 const SkPaint* paint) { |
178 return asSB(this)->onDraw(canvas, x, y, paint); | 182 return asSB(this)->onDraw(canvas, x, y, paint); |
179 } | 183 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 const SkSurfaceProps*) { | 216 const SkSurfaceProps*) { |
213 return nullptr; | 217 return nullptr; |
214 } | 218 } |
215 | 219 |
216 SkSurface* SkSurface::NewFromBackendRenderTarget(GrContext*, const GrBackendRend
erTargetDesc&, | 220 SkSurface* SkSurface::NewFromBackendRenderTarget(GrContext*, const GrBackendRend
erTargetDesc&, |
217 const SkSurfaceProps*) { | 221 const SkSurfaceProps*) { |
218 return nullptr; | 222 return nullptr; |
219 } | 223 } |
220 | 224 |
221 #endif | 225 #endif |
OLD | NEW |