| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 156 } |
| 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, ForceUnique unique) { |
| 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, unique); |
| 169 return image; | |
| 170 } | 169 } |
| 171 | 170 |
| 172 SkSurface* SkSurface::newSurface(const SkImageInfo& info) { | 171 SkSurface* SkSurface::newSurface(const SkImageInfo& info) { |
| 173 return asSB(this)->onNewSurface(info); | 172 return asSB(this)->onNewSurface(info); |
| 174 } | 173 } |
| 175 | 174 |
| 176 void SkSurface::draw(SkCanvas* canvas, SkScalar x, SkScalar y, | 175 void SkSurface::draw(SkCanvas* canvas, SkScalar x, SkScalar y, |
| 177 const SkPaint* paint) { | 176 const SkPaint* paint) { |
| 178 return asSB(this)->onDraw(canvas, x, y, paint); | 177 return asSB(this)->onDraw(canvas, x, y, paint); |
| 179 } | 178 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 const SkSurfaceProps*) { | 211 const SkSurfaceProps*) { |
| 213 return nullptr; | 212 return nullptr; |
| 214 } | 213 } |
| 215 | 214 |
| 216 SkSurface* SkSurface::NewFromBackendRenderTarget(GrContext*, const GrBackendRend
erTargetDesc&, | 215 SkSurface* SkSurface::NewFromBackendRenderTarget(GrContext*, const GrBackendRend
erTargetDesc&, |
| 217 const SkSurfaceProps*) { | 216 const SkSurfaceProps*) { |
| 218 return nullptr; | 217 return nullptr; |
| 219 } | 218 } |
| 220 | 219 |
| 221 #endif | 220 #endif |
| OLD | NEW |