aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SurfaceTest.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-02-29 11:41:52 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-29 11:41:52 -0800
commit84a4e5a8d683bf17d6c3058b977b9dfb000428af (patch)
tree2d1a39c9baee537c1457f03ea1c51d5a911c2432 /tests/SurfaceTest.cpp
parent3a9be690772f0417df2abe318c71e9b2fec0f8c5 (diff)
Remove internal calls to SkImage::getTexture
Diffstat (limited to 'tests/SurfaceTest.cpp')
-rw-r--r--tests/SurfaceTest.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 8166bba9bd..971e6b56f7 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -653,13 +653,13 @@ static void test_crbug263329(skiatest::Reporter* reporter,
// be recycling a texture that is held by an existing image.
canvas2->clear(5);
SkAutoTUnref<SkImage> image4(surface2->newImageSnapshot());
- REPORTER_ASSERT(reporter, as_IB(image4)->getTexture() != as_IB(image3)->getTexture());
+ REPORTER_ASSERT(reporter, as_IB(image4)->peekTexture() != as_IB(image3)->peekTexture());
// The following assertion checks crbug.com/263329
- REPORTER_ASSERT(reporter, as_IB(image4)->getTexture() != as_IB(image2)->getTexture());
- REPORTER_ASSERT(reporter, as_IB(image4)->getTexture() != as_IB(image1)->getTexture());
- REPORTER_ASSERT(reporter, as_IB(image3)->getTexture() != as_IB(image2)->getTexture());
- REPORTER_ASSERT(reporter, as_IB(image3)->getTexture() != as_IB(image1)->getTexture());
- REPORTER_ASSERT(reporter, as_IB(image2)->getTexture() != as_IB(image1)->getTexture());
+ REPORTER_ASSERT(reporter, as_IB(image4)->peekTexture() != as_IB(image2)->peekTexture());
+ REPORTER_ASSERT(reporter, as_IB(image4)->peekTexture() != as_IB(image1)->peekTexture());
+ REPORTER_ASSERT(reporter, as_IB(image3)->peekTexture() != as_IB(image2)->peekTexture());
+ REPORTER_ASSERT(reporter, as_IB(image3)->peekTexture() != as_IB(image1)->peekTexture());
+ REPORTER_ASSERT(reporter, as_IB(image2)->peekTexture() != as_IB(image1)->peekTexture());
}
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCRBug263329_Gpu, reporter, context) {
for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) {
@@ -673,20 +673,20 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCRBug263329_Gpu, reporter, context) {
DEF_TEST(SurfaceGetTexture, reporter) {
SkAutoTUnref<SkSurface> surface(create_surface());
SkAutoTUnref<SkImage> image(surface->newImageSnapshot());
- REPORTER_ASSERT(reporter, as_IB(image)->getTexture() == nullptr);
+ REPORTER_ASSERT(reporter, as_IB(image)->peekTexture() == nullptr);
surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode);
- REPORTER_ASSERT(reporter, as_IB(image)->getTexture() == nullptr);
+ REPORTER_ASSERT(reporter, as_IB(image)->peekTexture() == nullptr);
}
#if SK_SUPPORT_GPU
-DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceGetTexture_Gpu, reporter, context) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfacepeekTexture_Gpu, reporter, context) {
for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) {
SkAutoTUnref<SkSurface> surface(surface_func(context, kPremul_SkAlphaType, nullptr));
SkAutoTUnref<SkImage> image(surface->newImageSnapshot());
- GrTexture* texture = as_IB(image)->getTexture();
+ GrTexture* texture = as_IB(image)->peekTexture();
REPORTER_ASSERT(reporter, texture);
REPORTER_ASSERT(reporter, 0 != texture->getTextureHandle());
surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode);
- REPORTER_ASSERT(reporter, as_IB(image)->getTexture() == texture);
+ REPORTER_ASSERT(reporter, as_IB(image)->peekTexture() == texture);
}
}
#endif
@@ -702,7 +702,7 @@ static SkBudgeted is_budgeted(SkSurface* surf) {
}
static SkBudgeted is_budgeted(SkImage* image) {
- return ((SkImage_Gpu*)image)->getTexture()->resourcePriv().isBudgeted();
+ return ((SkImage_Gpu*)image)->peekTexture()->resourcePriv().isBudgeted();
}
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBudget, reporter, context) {
@@ -875,8 +875,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceClear_Gpu, reporter, context) {
s->getCanvas()->getDevice_just_for_deprecated_compatibility_testing();
return d->accessRenderTarget(); },
[] (SkSurface* s){ SkAutoTUnref<SkImage> i(s->newImageSnapshot());
- return i->getTexture(); },
- [] (SkSurface* s){ SkAutoTUnref<SkImage> i(s->newImageSnapshot());
return as_IB(i)->peekTexture(); },
};
for (auto grSurfaceGetter : grSurfaceGetters) {