aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/GrMipMappedTest.cpp
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2018-01-19 18:18:20 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-19 18:18:24 +0000
commit07320e46c0064dc1fe876f4621e94cb9ad529f85 (patch)
tree45d4d7d185beaa1d58e4b67c7c9eb60d9892d86f /tests/GrMipMappedTest.cpp
parentb69a2f66448603c26b0265201cec7161cf6d6f75 (diff)
Revert "Move more internal methods from GrContext to GrContextPriv"
This reverts commit f440cecbfdf1910104f36aedd0e963da2ae8b6a8. Reason for revert: breaking android builds. Original change's description: > Move more internal methods from GrContext to GrContextPriv > > TBR=bsalomon@google.com > Change-Id: Ia8cf0e0d30451c69bc7a08215aafa6abe6e0ddbe > Reviewed-on: https://skia-review.googlesource.com/97080 > Commit-Queue: Robert Phillips <robertphillips@google.com> > Reviewed-by: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: If263f8161f0fbe3fc6ee8f34bb09e237705c3694 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/97200 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'tests/GrMipMappedTest.cpp')
-rw-r--r--tests/GrMipMappedTest.cpp35
1 files changed, 15 insertions, 20 deletions
diff --git a/tests/GrMipMappedTest.cpp b/tests/GrMipMappedTest.cpp
index 006fd00a28..df1e8ee901 100644
--- a/tests/GrMipMappedTest.cpp
+++ b/tests/GrMipMappedTest.cpp
@@ -37,14 +37,12 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
if (!context->caps()->mipMapSupport()) {
return;
}
- GrGpu* gpu = context->contextPriv().getGpu();
-
for (auto mipMapped : {GrMipMapped::kNo, GrMipMapped::kYes}) {
for (auto isRT : {false, true}) {
// CreateTestingOnlyBackendTexture currently doesn't support uploading data to mip maps
// so we don't send any. However, we pretend there is data for the checks below which is
// fine since we are never actually using these textures for any work on the gpu.
- GrBackendTexture backendTex = gpu->createTestingOnlyBackendTexture(
+ GrBackendTexture backendTex = context->getGpu()->createTestingOnlyBackendTexture(
nullptr, kSize, kSize, kRGBA_8888_GrPixelConfig, isRT, mipMapped);
sk_sp<GrTextureProxy> proxy;
@@ -71,7 +69,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
}
REPORTER_ASSERT(reporter, proxy);
if (!proxy) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ context->getGpu()->deleteTestingOnlyBackendTexture(&backendTex);
return;
}
@@ -80,7 +78,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
GrTexture* texture = proxy->priv().peekTexture();
REPORTER_ASSERT(reporter, texture);
if (!texture) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ context->getGpu()->deleteTestingOnlyBackendTexture(&backendTex);
return;
}
@@ -94,7 +92,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
} else {
REPORTER_ASSERT(reporter, GrMipMapped::kNo == texture->texturePriv().mipMapped());
}
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ context->getGpu()->deleteTestingOnlyBackendTexture(&backendTex);
}
}
}
@@ -106,11 +104,9 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
if (!context->caps()->mipMapSupport()) {
return;
}
- GrGpu* gpu = context->contextPriv().getGpu();
-
for (auto mipMapped : {GrMipMapped::kNo, GrMipMapped::kYes}) {
for (auto willUseMips : {false, true}) {
- GrBackendTexture backendTex = gpu->createTestingOnlyBackendTexture(
+ GrBackendTexture backendTex = context->getGpu()->createTestingOnlyBackendTexture(
nullptr, kSize, kSize, kRGBA_8888_GrPixelConfig, false, mipMapped);
sk_sp<SkImage> image = SkImage::MakeFromTexture(context, backendTex,
@@ -122,7 +118,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
GrTextureProxy* proxy = as_IB(image)->peekProxy();
REPORTER_ASSERT(reporter, proxy);
if (!proxy) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ context->getGpu()->deleteTestingOnlyBackendTexture(&backendTex);
return;
}
@@ -131,7 +127,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
sk_sp<GrTexture> texture = sk_ref_sp(proxy->priv().peekTexture());
REPORTER_ASSERT(reporter, texture);
if (!texture) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ context->getGpu()->deleteTestingOnlyBackendTexture(&backendTex);
return;
}
@@ -139,7 +135,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
texture, kTopLeft_GrSurfaceOrigin, nullptr, kPremul_SkAlphaType, nullptr);
REPORTER_ASSERT(reporter, imageGen);
if (!imageGen) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ context->getGpu()->deleteTestingOnlyBackendTexture(&backendTex);
return;
}
@@ -155,7 +151,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
REPORTER_ASSERT(reporter, genProxy);
if (!genProxy) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ context->getGpu()->deleteTestingOnlyBackendTexture(&backendTex);
return;
}
@@ -168,7 +164,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
GrTexture* genTexture = genProxy->priv().peekTexture();
REPORTER_ASSERT(reporter, genTexture);
if (!genTexture) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ context->getGpu()->deleteTestingOnlyBackendTexture(&backendTex);
return;
}
@@ -206,7 +202,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
bitmap.allocPixels(imageInfo);
surfContext->readPixels(imageInfo, bitmap.getPixels(), 0, 0, 0, 0);
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ context->getGpu()->deleteTestingOnlyBackendTexture(&backendTex);
}
}
}
@@ -220,13 +216,12 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn
}
auto resourceProvider = context->contextPriv().resourceProvider();
- GrGpu* gpu = context->contextPriv().getGpu();
for (auto willUseMips : {false, true}) {
for (auto isWrapped : {false, true}) {
GrMipMapped mipMapped = willUseMips ? GrMipMapped::kYes : GrMipMapped::kNo;
sk_sp<SkSurface> surface;
- GrBackendTexture backendTex = gpu->createTestingOnlyBackendTexture(
+ GrBackendTexture backendTex = context->getGpu()->createTestingOnlyBackendTexture(
nullptr, kSize, kSize, kRGBA_8888_GrPixelConfig, true, mipMapped);
if (isWrapped) {
surface = SkSurface::MakeFromBackendTexture(context,
@@ -245,7 +240,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn
}
REPORTER_ASSERT(reporter, surface);
if (!surface) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ context->getGpu()->deleteTestingOnlyBackendTexture(&backendTex);
}
SkGpuDevice* device = ((SkSurface_Gpu*)surface.get())->getDevice();
GrTextureProxy* texProxy = device->accessRenderTargetContext()->asTextureProxy();
@@ -258,7 +253,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn
sk_sp<SkImage> image = surface->makeImageSnapshot();
REPORTER_ASSERT(reporter, image);
if (!image) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ context->getGpu()->deleteTestingOnlyBackendTexture(&backendTex);
}
texProxy = as_IB(image)->peekProxy();
REPORTER_ASSERT(reporter, mipMapped == texProxy->mipMapped());
@@ -270,7 +265,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn
// Must flush the context to make sure all the cmds (copies, etc.) from above are sent
// to the gpu before we delete the backendHandle.
context->flush();
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ context->getGpu()->deleteTestingOnlyBackendTexture(&backendTex);
}
}
}