aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SurfaceTest.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-03-20 08:38:50 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-20 13:50:35 +0000
commitac6b1fa2c8507bfd5f790bccaebab8e4018cb2cd (patch)
tree3e6e2707f3526193e81169ab084592bbf812404c /tests/SurfaceTest.cpp
parent6405e71279e99731f89db69325c6763ec62a98e1 (diff)
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>
Diffstat (limited to 'tests/SurfaceTest.cpp')
-rw-r--r--tests/SurfaceTest.cpp39
1 files changed, 18 insertions, 21 deletions
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index b85ac81788..6264196640 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -460,27 +460,24 @@ static SkBudgeted is_budgeted(const sk_sp<SkImage> image) {
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBudget, reporter, ctxInfo) {
SkImageInfo info = SkImageInfo::MakeN32Premul(8,8);
- for (auto sbudgeted : { SkBudgeted::kNo, SkBudgeted::kYes }) {
- for (auto ibudgeted : { SkBudgeted::kNo, SkBudgeted::kYes }) {
- auto surface(SkSurface::MakeRenderTarget(ctxInfo.grContext(), sbudgeted, info));
- SkASSERT(surface);
- REPORTER_ASSERT(reporter, sbudgeted == is_budgeted(surface));
-
- sk_sp<SkImage> image(surface->makeImageSnapshot(ibudgeted));
-
- // Initially the image shares a texture with the surface, and the surface decides
- // whether it is budgeted or not.
- REPORTER_ASSERT(reporter, sbudgeted == is_budgeted(surface));
- REPORTER_ASSERT(reporter, sbudgeted == is_budgeted(image));
-
- // Now trigger copy-on-write
- surface->getCanvas()->clear(SK_ColorBLUE);
-
- // They don't share a texture anymore. They should each have made their own budget
- // decision.
- REPORTER_ASSERT(reporter, sbudgeted == is_budgeted(surface));
- REPORTER_ASSERT(reporter, ibudgeted == is_budgeted(image));
- }
+ for (auto budgeted : { SkBudgeted::kNo, SkBudgeted::kYes }) {
+ auto surface(SkSurface::MakeRenderTarget(ctxInfo.grContext(), budgeted, info));
+ SkASSERT(surface);
+ REPORTER_ASSERT(reporter, budgeted == is_budgeted(surface));
+
+ sk_sp<SkImage> image(surface->makeImageSnapshot());
+
+ // Initially the image shares a texture with the surface, and the
+ // the budgets should always match.
+ REPORTER_ASSERT(reporter, budgeted == is_budgeted(surface));
+ REPORTER_ASSERT(reporter, budgeted == is_budgeted(image));
+
+ // Now trigger copy-on-write
+ surface->getCanvas()->clear(SK_ColorBLUE);
+
+ // They don't share a texture anymore but the budgets should still match.
+ REPORTER_ASSERT(reporter, budgeted == is_budgeted(surface));
+ REPORTER_ASSERT(reporter, budgeted == is_budgeted(image));
}
}
#endif