From 06ee8e8a3e418cc6e8be3aeac38dad2d45b4f28d Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Fri, 17 Mar 2017 20:50:06 +0000 Subject: 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 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 onNewImageSnapshot() = 0; ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:281:84: error: no viable conversion from 'sk_sp>' to 'sk_sp' 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 >' 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 >' to 'const sk_sp &' for 1st argument sk_sp(const sk_sp& that) : fPtr(SkSafeRef(that.get())) {} ^ external/skia/include/core/SkRefCnt.h:268:5: note: candidate constructor not viable: no known conversion from 'sk_sp >' to 'sk_sp &&' for 1st argument sk_sp(sk_sp&& 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] template using enable_if_t = typename std::enable_if::type; ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer] 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 surface); ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:312:58: error: no viable conversion from 'sk_sp>' to 'sk_sp' 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 >' 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 >' to 'const sk_sp &' for 1st argument sk_sp(const sk_sp& that) : fPtr(SkSafeRef(that.get())) {} ^ external/skia/include/core/SkRefCnt.h:268:5: note: candidate constructor not viable: no known conversion from 'sk_sp >' to 'sk_sp &&' for 1st argument sk_sp(sk_sp&& 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] template using enable_if_t = typename std::enable_if::type; ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer] 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 surface); ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:343:58: error: no viable conversion from 'sk_sp>' to 'sk_sp' 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 >' 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 >' to 'const sk_sp &' for 1st argument sk_sp(const sk_sp& that) : fPtr(SkSafeRef(that.get())) {} ^ external/skia/include/core/SkRefCnt.h:268:5: note: candidate constructor not viable: no known conversion from 'sk_sp >' to 'sk_sp &&' for 1st argument sk_sp(sk_sp&& 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] template using enable_if_t = typename std::enable_if::type; ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer] 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 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' T* canvas() { return static_cast(getCanvas()); } ^~~~~~~~~ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:282:27: note: in instantiation of member function '(anonymous namespace)::DeferLayer::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' T* canvas() { return static_cast(getCanvas()); } ^~~~~~~~~ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:313:27: note: in instantiation of member function '(anonymous namespace)::DeferLayer::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' T* canvas() { return static_cast(getCanvas()); } ^~~~~~~~~ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:344:27: note: in instantiation of member function '(anonymous namespace)::DeferLayer::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 > > > Commit-Queue: Robert Phillips > > > > > > > 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 > > Commit-Queue: Yuqian Li > > > > 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 > Commit-Queue: Robert Phillips > 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 Commit-Queue: Yuqian Li --- bench/GrMipMapBench.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bench/GrMipMapBench.cpp') diff --git a/bench/GrMipMapBench.cpp b/bench/GrMipMapBench.cpp index 89100e346d..7b8ce3f3c9 100644 --- a/bench/GrMipMapBench.cpp +++ b/bench/GrMipMapBench.cpp @@ -55,7 +55,7 @@ protected: // Draw reduced version of surface to original canvas, to trigger mip generation canvas->save(); canvas->scale(0.1f, 0.1f); - canvas->drawImage(fSurface->makeImageSnapshot(), 0, 0, &paint); + canvas->drawImage(fSurface->makeImageSnapshot(SkBudgeted::kNo), 0, 0, &paint); canvas->restore(); } } -- cgit v1.2.3