Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Unified Diff: tests/SurfaceTest.cpp

Issue 1166993002: Towards removing getTexture() from SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SurfaceTest.cpp
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 4803b68221f708cb9e9ad64a835bcfe9855317e2..65c0c3b53d03ece7734a165ed7eccaf7c2a8ad76 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -9,6 +9,7 @@
#include "SkData.h"
#include "SkDevice.h"
#include "SkImageEncoder.h"
+#include "SkImage_Base.h"
#include "SkRRect.h"
#include "SkSurface.h"
#include "SkUtils.h"
@@ -528,13 +529,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, image4->getTexture() != image3->getTexture());
+ REPORTER_ASSERT(reporter, as_IB(image4)->getTexture() != as_IB(image3)->getTexture());
// The following assertion checks crbug.com/263329
- REPORTER_ASSERT(reporter, image4->getTexture() != image2->getTexture());
- REPORTER_ASSERT(reporter, image4->getTexture() != image1->getTexture());
- REPORTER_ASSERT(reporter, image3->getTexture() != image2->getTexture());
- REPORTER_ASSERT(reporter, image3->getTexture() != image1->getTexture());
- REPORTER_ASSERT(reporter, image2->getTexture() != image1->getTexture());
+ 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());
}
static void TestGetTexture(skiatest::Reporter* reporter,
@@ -542,7 +543,7 @@ static void TestGetTexture(skiatest::Reporter* reporter,
GrContext* context) {
SkAutoTUnref<SkSurface> surface(createSurface(surfaceType, context));
SkAutoTUnref<SkImage> image(surface->newImageSnapshot());
- GrTexture* texture = image->getTexture();
+ GrTexture* texture = as_IB(image)->getTexture();
if (surfaceType == kGpu_SurfaceType || surfaceType == kGpuScratch_SurfaceType) {
REPORTER_ASSERT(reporter, texture);
REPORTER_ASSERT(reporter, 0 != texture->getTextureHandle());
@@ -550,7 +551,7 @@ static void TestGetTexture(skiatest::Reporter* reporter,
REPORTER_ASSERT(reporter, NULL == texture);
}
surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode);
- REPORTER_ASSERT(reporter, image->getTexture() == texture);
+ REPORTER_ASSERT(reporter, as_IB(image)->getTexture() == texture);
}
#include "GrGpuResourcePriv.h"
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698