Commit Graph

17 Commits

Author SHA1 Message Date
Robert Phillips
ac6b1fa2c8 Remove budgeted parameter from SkSurface::makeImageSnapshot (take 2)
This unused feature complicates MDB.

Chrome compiles locally for me with this CL.
frameworks/base/libs/hwui compiles locally for me with this CL.

Change-Id: Id3ad64dac72eace52855896df0d7ce3679f15884
Reviewed-on: https://skia-review.googlesource.com/9882
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-20 13:50:35 +00:00
Yuqian Li
06ee8e8a3e Revert "Revert "Revert "Remove budgeted parameter from SkSurface::makeImageSnapshot"""
This reverts commit 31249bb2df.

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 9e9188f84b.
> 
> Reason for revert: Android-side fix has landed
> 
> Original change's description:
> > Revert "Remove budgeted parameter from SkSurface::makeImageSnapshot"
> > 
> > This reverts commit b64bcbdc3a.
> > 
> > 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>
2017-03-17 20:50:19 +00:00
Robert Phillips
31249bb2df Revert "Revert "Remove budgeted parameter from SkSurface::makeImageSnapshot""
This reverts commit 9e9188f84b.

Reason for revert: Android-side fix has landed

Original change's description:
> Revert "Remove budgeted parameter from SkSurface::makeImageSnapshot"
> 
> This reverts commit b64bcbdc3a.
> 
> 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>
2017-03-17 17:44:01 +00:00
Yuqian Li
9e9188f84b Revert "Remove budgeted parameter from SkSurface::makeImageSnapshot"
This reverts commit b64bcbdc3a.

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>
2017-03-16 15:05:04 +00:00
Robert Phillips
b64bcbdc3a 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>
2017-03-16 13:36:06 +00:00
bsalomon
b1792f1121 Rewrite GrTextureMipMapInvalidationTest using SkImage
BUG=skia:5531
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2149133002

Review-Url: https://codereview.chromium.org/2149133002
2016-07-14 09:24:08 -07:00
bsalomon
614d8f9a3c Remove GrWrapTextureInBitmap from public API
BUG=skia:5531
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2147053002

Review-Url: https://codereview.chromium.org/2147053002
2016-07-13 15:42:40 -07:00
bsalomon
8b7451aaf6 Turn ContextInfos returned by GrContextFactory into structs.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1966013002

Review-Url: https://codereview.chromium.org/1966013002
2016-05-11 06:33:06 -07:00
bsalomon
758586c7f1 Make existing unit tests only run on GL contexts
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1869503002

Review URL: https://codereview.chromium.org/1869503002
2016-04-06 14:02:39 -07:00
bsalomon
f2f1c17e33 One signature for creating unit tests that run on premade GrContexts
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1860593002

Review URL: https://codereview.chromium.org/1860593002
2016-04-05 12:59:06 -07:00
reed
e8f3062a36 switch surface to sk_sp
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1817383002
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot

Review URL: https://codereview.chromium.org/1817383002
2016-03-23 18:59:25 -07:00
bsalomon
5ec26ae9bf Move Budgeted enum out of SkSurface, use in GrTextureProvider
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1728093005
DOCS_PREVIEW= https://skia.org/?cl=1728093005

Committed: https://skia.googlesource.com/skia/+/57599fe6c0336feaeeeb9b1996e77b70219b483c
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot

Review URL: https://codereview.chromium.org/1728093005
2016-02-25 08:33:02 -08:00
bsalomon
bd500f09ce Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider (patchset #6 id:100001 of https://codereview.chromium.org/1728093005/ )
Reason for revert:
Need workaround for chrome to build

Original issue's description:
> Move Budgeted enum out of SkSurface, use in GrTextureProvider
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1728093005
> DOCS_PREVIEW= https://skia.org/?cl=1728093005
>
> Committed: https://skia.googlesource.com/skia/+/57599fe6c0336feaeeeb9b1996e77b70219b483c

TBR=reed@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1734043002
2016-02-25 06:52:12 -08:00
bsalomon
57599fe6c0 Move Budgeted enum out of SkSurface, use in GrTextureProvider
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1728093005
DOCS_PREVIEW= https://skia.org/?cl=1728093005

Review URL: https://codereview.chromium.org/1728093005
2016-02-25 06:33:27 -08:00
kkinnunen
1530283c48 Generate list of GPU contexts outside tests
Use DEF_GPUTEST_FOR_*_CONTEXT macros to obtain the
test GPU context.

Makes changing the context -related classes easier,
since not all tests need to be changed.

BUG=skia:2992

Review URL: https://codereview.chromium.org/1448873002
2015-12-01 04:35:26 -08:00
halcanary
96fcdcc219 Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
2015-08-27 07:41:16 -07:00
junov
da5469d7bc Invalidate GrTexture mipmap on content change notification
This fix is necessary to correctly propagate invalidations that
are external to skia. For example, when drawing video or WebGL
into a 2D canvas in Chrome, with mipmaps enabled.

BUG=crbug.com/498356
TEST=GrTextureMipMapInvalidationTest

Review URL: https://codereview.chromium.org/1177843007
2015-06-15 09:48:15 -07:00