| 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 #ifndef SkSurface_Base_DEFINED | 8 #ifndef SkSurface_Base_DEFINED |
| 9 #define SkSurface_Base_DEFINED | 9 #define SkSurface_Base_DEFINED |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 * being shared with the cachedImage. | 68 * being shared with the cachedImage. |
| 69 */ | 69 */ |
| 70 virtual void onCopyOnWrite(ContentChangeMode) = 0; | 70 virtual void onCopyOnWrite(ContentChangeMode) = 0; |
| 71 | 71 |
| 72 /** | 72 /** |
| 73 * Signal the surface to remind its backing store that it's mutable again. | 73 * Signal the surface to remind its backing store that it's mutable again. |
| 74 * Called only when we _didn't_ copy-on-write; we assume the copies start m
utable. | 74 * Called only when we _didn't_ copy-on-write; we assume the copies start m
utable. |
| 75 */ | 75 */ |
| 76 virtual void onRestoreBackingMutability() {} | 76 virtual void onRestoreBackingMutability() {} |
| 77 | 77 |
| 78 virtual bool onBlitWithGamma(SkImage*, SkScalar gamma) { return false; } |
| 79 |
| 78 /** | 80 /** |
| 79 * Issue any pending surface IO to the current backend 3D API and resolve an
y surface MSAA. | 81 * Issue any pending surface IO to the current backend 3D API and resolve an
y surface MSAA. |
| 80 */ | 82 */ |
| 81 virtual void onPrepareForExternalIO() {} | 83 virtual void onPrepareForExternalIO() {} |
| 82 | 84 |
| 83 inline SkCanvas* getCachedCanvas(); | 85 inline SkCanvas* getCachedCanvas(); |
| 84 inline sk_sp<SkImage> refCachedImage(SkBudgeted, ForceUnique); | 86 inline sk_sp<SkImage> refCachedImage(SkBudgeted, ForceUnique); |
| 85 | 87 |
| 86 bool hasCachedImage() const { return fCachedImage != nullptr; } | 88 bool hasCachedImage() const { return fCachedImage != nullptr; } |
| 87 | 89 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 snap = this->onNewImageSnapshot(budgeted, fcm).release(); | 129 snap = this->onNewImageSnapshot(budgeted, fcm).release(); |
| 128 if (kNo_ForceUnique == unique) { | 130 if (kNo_ForceUnique == unique) { |
| 129 SkASSERT(!fCachedImage); | 131 SkASSERT(!fCachedImage); |
| 130 fCachedImage = SkSafeRef(snap); | 132 fCachedImage = SkSafeRef(snap); |
| 131 } | 133 } |
| 132 SkASSERT(!fCachedCanvas || fCachedCanvas->getSurfaceBase() == this); | 134 SkASSERT(!fCachedCanvas || fCachedCanvas->getSurfaceBase() == this); |
| 133 return sk_sp<SkImage>(snap); | 135 return sk_sp<SkImage>(snap); |
| 134 } | 136 } |
| 135 | 137 |
| 136 #endif | 138 #endif |
| OLD | NEW |