aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ResourceAllocatorTest.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-11-16 07:52:08 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-16 16:35:57 +0000
commiteafd48af63aef270cbea139547bb4fa8a591748d (patch)
treec59febed663b2e00ab9af5eb8ad239a3efded290 /tests/ResourceAllocatorTest.cpp
parent5627d65146cb92624b682389e017d488872228c7 (diff)
Add overbudget handling to GrResourceAllocator
Change-Id: I5536c908310e907c77b5d55441a0edac6a74bf0e Reviewed-on: https://skia-review.googlesource.com/71182 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/ResourceAllocatorTest.cpp')
-rw-r--r--tests/ResourceAllocatorTest.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/ResourceAllocatorTest.cpp b/tests/ResourceAllocatorTest.cpp
index bb4acf013f..02785e6aa1 100644
--- a/tests/ResourceAllocatorTest.cpp
+++ b/tests/ResourceAllocatorTest.cpp
@@ -73,8 +73,10 @@ static void overlap_test(skiatest::Reporter* reporter, GrResourceProvider* resou
alloc.addInterval(p1.get(), 0, 4);
alloc.addInterval(p2.get(), 1, 2);
+ alloc.markEndOfOpList(0);
- alloc.assign();
+ int startIndex, stopIndex;
+ alloc.assign(&startIndex, &stopIndex);
REPORTER_ASSERT(reporter, p1->priv().peekSurface());
REPORTER_ASSERT(reporter, p2->priv().peekSurface());
@@ -91,8 +93,10 @@ static void non_overlap_test(skiatest::Reporter* reporter, GrResourceProvider* r
alloc.addInterval(p1.get(), 0, 2);
alloc.addInterval(p2.get(), 3, 5);
+ alloc.markEndOfOpList(0);
- alloc.assign();
+ int startIndex, stopIndex;
+ alloc.assign(&startIndex, &stopIndex);
REPORTER_ASSERT(reporter, p1->priv().peekSurface());
REPORTER_ASSERT(reporter, p2->priv().peekSurface());
@@ -139,7 +143,8 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceAllocatorTest, reporter, ctxInfo) {
for (auto test : gOverlappingTests) {
sk_sp<GrSurfaceProxy> p1 = make_deferred(resourceProvider, test.fP1);
sk_sp<GrSurfaceProxy> p2 = make_deferred(resourceProvider, test.fP2);
- overlap_test(reporter, resourceProvider, std::move(p1), std::move(p2), test.fExpectation);
+ overlap_test(reporter, resourceProvider,
+ std::move(p1), std::move(p2), test.fExpectation);
}
int k2 = ctxInfo.grContext()->caps()->getSampleCount(2, kRGBA);
@@ -180,8 +185,8 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceAllocatorTest, reporter, ctxInfo) {
if (!p1 || !p2) {
continue; // creation can fail (i.e., for msaa4 on iOS)
}
- non_overlap_test(reporter, resourceProvider, std::move(p1), std::move(p2),
- test.fExpectation);
+ non_overlap_test(reporter, resourceProvider,
+ std::move(p1), std::move(p2), test.fExpectation);
}
{
@@ -193,8 +198,8 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceAllocatorTest, reporter, ctxInfo) {
GrBackendObject backEndObj;
sk_sp<GrSurfaceProxy> p1 = make_backend(ctxInfo.grContext(), t[0].fP1, &backEndObj);
sk_sp<GrSurfaceProxy> p2 = make_deferred(resourceProvider, t[0].fP2);
- non_overlap_test(reporter, resourceProvider, std::move(p1), std::move(p2),
- t[0].fExpectation);
+ non_overlap_test(reporter, resourceProvider,
+ std::move(p1), std::move(p2), t[0].fExpectation);
cleanup_backend(ctxInfo.grContext(), &backEndObj);
}
}