remove unused parameter in onNewimageSnapshot
BUG=skia:
Change-Id: I59b4cbace841489698fb22828c35b82a738d06b3
Reviewed-on: https://skia-review.googlesource.com/6494
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/image/SkSurface_Base.h b/src/image/SkSurface_Base.h
index 8c41ef5..27d2350 100644
--- a/src/image/SkSurface_Base.h
+++ b/src/image/SkSurface_Base.h
@@ -43,7 +43,7 @@
* must faithfully represent the current contents, even if the surface
* is changed after this called (e.g. it is drawn to via its canvas).
*/
- virtual sk_sp<SkImage> onNewImageSnapshot(SkBudgeted, SkCopyPixelsMode) = 0;
+ virtual sk_sp<SkImage> onNewImageSnapshot(SkBudgeted) = 0;
/**
* Default implementation:
@@ -120,7 +120,7 @@
return sk_ref_sp(snap);
}
- snap = this->onNewImageSnapshot(budgeted, kIfMutable_SkCopyPixelsMode).release();
+ snap = this->onNewImageSnapshot(budgeted).release();
SkASSERT(!fCachedImage);
fCachedImage = SkSafeRef(snap);
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 17376ea..d34c9b4 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -82,7 +82,7 @@
origin, &this->props());
}
-sk_sp<SkImage> SkSurface_Gpu::onNewImageSnapshot(SkBudgeted budgeted, SkCopyPixelsMode cpm) {
+sk_sp<SkImage> SkSurface_Gpu::onNewImageSnapshot(SkBudgeted budgeted) {
GrRenderTargetContext* rtc = fDevice->accessRenderTargetContext();
if (!rtc) {
return nullptr;
@@ -95,7 +95,7 @@
// If the original render target is a buffer originally created by the client, then we don't
// want to ever retarget the SkSurface at another buffer we create. Force a copy now to avoid
// copy-on-write.
- if (kAlways_SkCopyPixelsMode == cpm || !srcProxy || rtc->priv().refsWrappedObjects()) {
+ if (!srcProxy || rtc->priv().refsWrappedObjects()) {
GrSurfaceDesc desc = rtc->desc();
desc.fFlags = desc.fFlags & ~kRenderTarget_GrSurfaceFlag;
diff --git a/src/image/SkSurface_Gpu.h b/src/image/SkSurface_Gpu.h
index b7088ea..a625473 100644
--- a/src/image/SkSurface_Gpu.h
+++ b/src/image/SkSurface_Gpu.h
@@ -23,7 +23,7 @@
bool onGetRenderTargetHandle(GrBackendObject*, BackendHandleAccess) override;
SkCanvas* onNewCanvas() override;
sk_sp<SkSurface> onNewSurface(const SkImageInfo&) override;
- sk_sp<SkImage> onNewImageSnapshot(SkBudgeted, SkCopyPixelsMode) override;
+ sk_sp<SkImage> onNewImageSnapshot(SkBudgeted) override;
void onCopyOnWrite(ContentChangeMode) override;
void onDiscard() override;
void onPrepareForExternalIO() override;
diff --git a/src/image/SkSurface_Raster.cpp b/src/image/SkSurface_Raster.cpp
index 2f26e7f..47e0dbe 100644
--- a/src/image/SkSurface_Raster.cpp
+++ b/src/image/SkSurface_Raster.cpp
@@ -24,7 +24,7 @@
SkCanvas* onNewCanvas() override;
sk_sp<SkSurface> onNewSurface(const SkImageInfo&) override;
- sk_sp<SkImage> onNewImageSnapshot(SkBudgeted, SkCopyPixelsMode) override;
+ sk_sp<SkImage> onNewImageSnapshot(SkBudgeted) override;
void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) override;
void onCopyOnWrite(ContentChangeMode) override;
void onRestoreBackingMutability() override;
@@ -130,7 +130,8 @@
canvas->drawBitmap(fBitmap, x, y, paint);
}
-sk_sp<SkImage> SkSurface_Raster::onNewImageSnapshot(SkBudgeted, SkCopyPixelsMode cpm) {
+sk_sp<SkImage> SkSurface_Raster::onNewImageSnapshot(SkBudgeted) {
+ SkCopyPixelsMode cpm = kIfMutable_SkCopyPixelsMode;
if (fWeOwnThePixels) {
// SkImage_raster requires these pixels are immutable for its full lifetime.
// We'll undo this via onRestoreBackingMutability() if we can avoid the COW.