aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkImage_Gpu.h
diff options
context:
space:
mode:
authorGravatar Yuqian Li <liyuqian@google.com>2017-03-17 20:50:06 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-17 20:50:19 +0000
commit06ee8e8a3e418cc6e8be3aeac38dad2d45b4f28d (patch)
tree70c24ae6d3bbb3911640c19107424098bf37b5ae /src/image/SkImage_Gpu.h
parent980fb367daf2fee1e284b44d0d4ddd2957b87e1a (diff)
Revert "Revert "Revert "Remove budgeted parameter from SkSurface::makeImageSnapshot"""
This reverts commit 31249bb2df023868e4585f14519bf17c835f8700. Reason for revert: Android build is still broken as shown below. out/target/product/bullhead/obj/NATIVE_TESTS/hwui_unit_tests_intermediates/tests/unit/SkiaPipelineTests.o frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp" frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:211:51: error: non-virtual member function marked 'override' hides virtual member function sk_sp<SkImage> onNewImageSnapshot(SkBudgeted) override { ^ external/skia/src/image/SkSurface_Base.h:46:28: note: hidden overloaded virtual function 'SkSurface_Base::onNewImageSnapshot' declared here: different number of parameters (0 vs 1) virtual sk_sp<SkImage> onNewImageSnapshot() = 0; ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:281:84: error: no viable conversion from 'sk_sp<DeferLayer<DeferTestCanvas>>' to 'sk_sp<SkSurface>' pipeline->renderFrame(layerUpdateQueue, dirty, nodes, true, contentDrawBounds, surface); ^~~~~~~ external/skia/include/core/SkRefCnt.h:253:15: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<DeferTestCanvas> >' to 'std::nullptr_t' (aka 'nullptr_t') for 1st argument constexpr sk_sp(std::nullptr_t) : fPtr(nullptr) {} ^ external/skia/include/core/SkRefCnt.h:259:5: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<DeferTestCanvas> >' to 'const sk_sp<SkSurface> &' for 1st argument sk_sp(const sk_sp<T>& that) : fPtr(SkSafeRef(that.get())) {} ^ external/skia/include/core/SkRefCnt.h:268:5: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<DeferTestCanvas> >' to 'sk_sp<SkSurface> &&' for 1st argument sk_sp(sk_sp<T>&& that) : fPtr(that.release()) {} ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer<DeferTestCanvas>] template <bool B, typename T = void> using enable_if_t = typename std::enable_if<B, T>::type; ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer<DeferTestCanvas>] external/skia/include/core/SkRefCnt.h:327:5: note: candidate function operator unspecified_bool_type() const { return this->get() ? &sk_sp::fPtr : nullptr; } ^ frameworks/base/libs/hwui/pipeline/skia/SkiaPipeline.h:50:30: note: passing argument to parameter 'surface' here sk_sp<SkSurface> surface); ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:312:58: error: no viable conversion from 'sk_sp<DeferLayer<ClippedTestCanvas>>' to 'sk_sp<SkSurface>' SkRect::MakeWH(CANVAS_WIDTH, CANVAS_HEIGHT), surface); ^~~~~~~ external/skia/include/core/SkRefCnt.h:253:15: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<ClippedTestCanvas> >' to 'std::nullptr_t' (aka 'nullptr_t') for 1st argument constexpr sk_sp(std::nullptr_t) : fPtr(nullptr) {} ^ external/skia/include/core/SkRefCnt.h:259:5: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<ClippedTestCanvas> >' to 'const sk_sp<SkSurface> &' for 1st argument sk_sp(const sk_sp<T>& that) : fPtr(SkSafeRef(that.get())) {} ^ external/skia/include/core/SkRefCnt.h:268:5: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<ClippedTestCanvas> >' to 'sk_sp<SkSurface> &&' for 1st argument sk_sp(sk_sp<T>&& that) : fPtr(that.release()) {} ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer<ClippedTestCanvas>] template <bool B, typename T = void> using enable_if_t = typename std::enable_if<B, T>::type; ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer<ClippedTestCanvas>] external/skia/include/core/SkRefCnt.h:327:5: note: candidate function operator unspecified_bool_type() const { return this->get() ? &sk_sp::fPtr : nullptr; } ^ frameworks/base/libs/hwui/pipeline/skia/SkiaPipeline.h:50:30: note: passing argument to parameter 'surface' here sk_sp<SkSurface> surface); ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:343:58: error: no viable conversion from 'sk_sp<DeferLayer<ClipReplaceTestCanvas>>' to 'sk_sp<SkSurface>' SkRect::MakeWH(CANVAS_WIDTH, CANVAS_HEIGHT), surface); ^~~~~~~ external/skia/include/core/SkRefCnt.h:253:15: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<ClipReplaceTestCanvas> >' to 'std::nullptr_t' (aka 'nullptr_t') for 1st argument constexpr sk_sp(std::nullptr_t) : fPtr(nullptr) {} ^ external/skia/include/core/SkRefCnt.h:259:5: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<ClipReplaceTestCanvas> >' to 'const sk_sp<SkSurface> &' for 1st argument sk_sp(const sk_sp<T>& that) : fPtr(SkSafeRef(that.get())) {} ^ external/skia/include/core/SkRefCnt.h:268:5: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<ClipReplaceTestCanvas> >' to 'sk_sp<SkSurface> &&' for 1st argument sk_sp(sk_sp<T>&& that) : fPtr(that.release()) {} ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer<ClipReplaceTestCanvas>] template <bool B, typename T = void> using enable_if_t = typename std::enable_if<B, T>::type; ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer<ClipReplaceTestCanvas>] external/skia/include/core/SkRefCnt.h:327:5: note: candidate function operator unspecified_bool_type() const { return this->get() ? &sk_sp::fPtr : nullptr; } ^ frameworks/base/libs/hwui/pipeline/skia/SkiaPipeline.h:50:30: note: passing argument to parameter 'surface' here sk_sp<SkSurface> surface); ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:214:42: error: cannot initialize object parameter of type 'SkSurface' with an expression of type '(anonymous namespace)::DeferLayer<DeferTestCanvas>' T* canvas() { return static_cast<T*>(getCanvas()); } ^~~~~~~~~ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:282:27: note: in instantiation of member function '(anonymous namespace)::DeferLayer<DeferTestCanvas>::canvas' requested here EXPECT_EQ(4, surface->canvas()->mDrawCounter); ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:214:42: error: cannot initialize object parameter of type 'SkSurface' with an expression of type '(anonymous namespace)::DeferLayer<ClippedTestCanvas>' T* canvas() { return static_cast<T*>(getCanvas()); } ^~~~~~~~~ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:313:27: note: in instantiation of member function '(anonymous namespace)::DeferLayer<ClippedTestCanvas>::canvas' requested here EXPECT_EQ(1, surface->canvas()->mDrawCounter); ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:214:42: error: cannot initialize object parameter of type 'SkSurface' with an expression of type '(anonymous namespace)::DeferLayer<ClipReplaceTestCanvas>' T* canvas() { return static_cast<T*>(getCanvas()); } ^~~~~~~~~ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:344:27: note: in instantiation of member function '(anonymous namespace)::DeferLayer<ClipReplaceTestCanvas>::canvas' requested here EXPECT_EQ(1, surface->canvas()->mDrawCounter); Original change's description: > Revert "Revert "Remove budgeted parameter from SkSurface::makeImageSnapshot"" > > This reverts commit 9e9188f84b15a25e27f63d5f8de3ccd393d9a173. > > Reason for revert: Android-side fix has landed > > Original change's description: > > Revert "Remove budgeted parameter from SkSurface::makeImageSnapshot" > > > > This reverts commit b64bcbdc3a5aa7b9e3ff216e4617ddc1db9260b5. > > > > Reason for revert: > > > > Android build failed as shown below. > > > > frameworks/base/libs/hwui/VkLayer.cpp:32:41: error: too many arguments to function call, expected 0, have 1 > > mImage = surface->makeImageSnapshot(SkBudgeted::kNo); > > > > Original change's description: > > > Remove budgeted parameter from SkSurface::makeImageSnapshot > > > > > > This unused feature complicates MDB. > > > > > > Chrome compiles locally for me with this CL. > > > > > > Change-Id: I611e464885fb984030eace43ead42cf39d0e7f72 > > > Reviewed-on: https://skia-review.googlesource.com/9734 > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > Commit-Queue: Robert Phillips <robertphillips@google.com> > > > > > > > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org > > NOPRESUBMIT=true > > NOTREECHECKS=true > > NOTRY=true > > > > Change-Id: Iae6e313c15b2352bd0d4fc7b5629de0a51ac398e > > Reviewed-on: https://skia-review.googlesource.com/9788 > > Reviewed-by: Yuqian Li <liyuqian@google.com> > > Commit-Queue: Yuqian Li <liyuqian@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org,liyuqian@google.com > # Not skipping CQ checks because original CL landed > 1 day ago. > > Change-Id: If07d1b5db6e6c618d37445a0cf127780ed243a92 > Reviewed-on: https://skia-review.googlesource.com/9843 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org,liyuqian@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I674b0a9d4130e00164d2e0344a92c373cf70f4fd Reviewed-on: https://skia-review.googlesource.com/9873 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'src/image/SkImage_Gpu.h')
-rw-r--r--src/image/SkImage_Gpu.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/image/SkImage_Gpu.h b/src/image/SkImage_Gpu.h
index 53c38dc278..b3a165d079 100644
--- a/src/image/SkImage_Gpu.h
+++ b/src/image/SkImage_Gpu.h
@@ -29,6 +29,14 @@ public:
SkImageInfo onImageInfo() const override;
SkAlphaType onAlphaType() const override { return fAlphaType; }
+ void applyBudgetDecision() const {
+ if (SkBudgeted::kYes == fBudgeted) {
+ fProxy->priv().makeBudgeted();
+ } else {
+ fProxy->priv().makeUnbudgeted();
+ }
+ }
+
bool getROPixels(SkBitmap*, SkColorSpace* dstColorSpace, CachingHint) const override;
GrTexture* asTextureRef(GrContext*, const GrSamplerParams&, SkColorSpace*,
sk_sp<SkColorSpace>*, SkScalar scaleAdjust[2]) const override;