diff options
author | bsalomon <bsalomon@google.com> | 2015-02-06 08:49:24 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-06 08:49:24 -0800 |
commit | d0423587ac56ae84d3f1eb796d5c1e2dfba9646e (patch) | |
tree | 1bbbc8adbc1b63dc7dd19ffc08889be9a80b89c5 /tests | |
parent | 02c8fd0ad5e5279004dd49ec49fbae00f8522ec0 (diff) |
One createTexture function, attempt to recycle scratch in createTexture.
Review URL: https://codereview.chromium.org/864383003
Diffstat (limited to 'tests')
-rw-r--r-- | tests/BlurTest.cpp | 2 | ||||
-rw-r--r-- | tests/ClipCacheTest.cpp | 4 | ||||
-rw-r--r-- | tests/FloatingPointTextureTest.cpp | 8 | ||||
-rw-r--r-- | tests/GLProgramsTest.cpp | 2 | ||||
-rw-r--r-- | tests/GrSurfaceTest.cpp | 4 | ||||
-rw-r--r-- | tests/ReadPixelsTest.cpp | 3 | ||||
-rw-r--r-- | tests/ReadWriteAlphaTest.cpp | 2 | ||||
-rw-r--r-- | tests/RecordReplaceDrawTest.cpp | 2 | ||||
-rw-r--r-- | tests/WritePixelsTest.cpp | 3 |
9 files changed, 14 insertions, 16 deletions
diff --git a/tests/BlurTest.cpp b/tests/BlurTest.cpp index 62c11e05fa..4dad71df48 100644 --- a/tests/BlurTest.cpp +++ b/tests/BlurTest.cpp @@ -291,7 +291,7 @@ static bool gpu_blur_path(GrContextFactory* factory, const SkPath& path, desc.fHeight = 30; desc.fSampleCnt = 0; - SkAutoTUnref<GrTexture> texture(grContext->createUncachedTexture(desc, NULL, 0)); + SkAutoTUnref<GrTexture> texture(grContext->createTexture(desc, false, NULL, 0)); SkAutoTUnref<SkGpuDevice> device(SkNEW_ARGS(SkGpuDevice, (grContext, texture.get()))); SkCanvas canvas(device.get()); diff --git a/tests/ClipCacheTest.cpp b/tests/ClipCacheTest.cpp index 1df10538b5..1e195ccc2e 100644 --- a/tests/ClipCacheTest.cpp +++ b/tests/ClipCacheTest.cpp @@ -31,7 +31,7 @@ static GrTexture* createTexture(GrContext* context) { desc.fHeight = Y_SIZE; // We are initializing the texture with zeros here - GrTexture* texture = context->createUncachedTexture(desc, textureData, 0); + GrTexture* texture = context->createTexture(desc, false, textureData, 0); if (!texture) { return NULL; } @@ -52,7 +52,7 @@ static void test_clip_bounds(skiatest::Reporter* reporter, GrContext* context) { desc.fWidth = kXSize; desc.fHeight = kYSize; - GrTexture* texture = context->createUncachedTexture(desc, NULL, 0); + GrTexture* texture = context->createTexture(desc, false, NULL, 0); if (!texture) { return; } diff --git a/tests/FloatingPointTextureTest.cpp b/tests/FloatingPointTextureTest.cpp index 3bc87f6102..7ac27cb6a4 100644 --- a/tests/FloatingPointTextureTest.cpp +++ b/tests/FloatingPointTextureTest.cpp @@ -59,8 +59,8 @@ DEF_GPUTEST(FloatingPointTextureTest, reporter, factory) { continue; } - SkAutoTUnref<GrTexture> fpTexture( - context->createUncachedTexture(desc, controlPixelData.begin(), 0)); + SkAutoTUnref<GrTexture> fpTexture(context->createTexture(desc, false, + controlPixelData.begin(), 0)); // Floating point textures are NOT supported everywhere if (NULL == fpTexture) { continue; @@ -106,8 +106,8 @@ DEF_GPUTEST(HalfFloatTextureTest, reporter, factory) { continue; } - SkAutoTUnref<GrTexture> fpTexture( - context->createUncachedTexture(desc, controlPixelData.begin(), 0)); + SkAutoTUnref<GrTexture> fpTexture(context->createTexture(desc, false, + controlPixelData.begin(), 0)); // 16-bit floating point textures are NOT supported everywhere if (NULL == fpTexture) { continue; diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index 30f34587a4..08222bf32e 100644 --- a/tests/GLProgramsTest.cpp +++ b/tests/GLProgramsTest.cpp @@ -116,7 +116,7 @@ static GrRenderTarget* random_render_target(GrContext* context, SkRandom* random GrTexture* texture = context->findAndRefCachedTexture(key); if (!texture) { - texture = context->createTexture(texDesc); + texture = context->createTexture(texDesc, true); if (texture) { SkAssertResult(context->addResourceToCache(key, texture)); } diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp index 1e21df1972..094ca7829a 100644 --- a/tests/GrSurfaceTest.cpp +++ b/tests/GrSurfaceTest.cpp @@ -27,7 +27,7 @@ DEF_GPUTEST(GrSurface, reporter, factory) { desc.fWidth = 256; desc.fHeight = 256; desc.fSampleCnt = 0; - GrSurface* texRT1 = context->createUncachedTexture(desc, NULL, 0); + GrSurface* texRT1 = context->createTexture(desc, false, NULL, 0); REPORTER_ASSERT(reporter, texRT1 == texRT1->asRenderTarget()); REPORTER_ASSERT(reporter, texRT1 == texRT1->asTexture()); @@ -39,7 +39,7 @@ DEF_GPUTEST(GrSurface, reporter, factory) { static_cast<GrSurface*>(texRT1->asTexture())); desc.fFlags = kNone_GrSurfaceFlags; - GrSurface* tex1 = context->createUncachedTexture(desc, NULL, 0); + GrSurface* tex1 = context->createTexture(desc, false, NULL, 0); REPORTER_ASSERT(reporter, NULL == tex1->asRenderTarget()); REPORTER_ASSERT(reporter, tex1 == tex1->asTexture()); REPORTER_ASSERT(reporter, static_cast<GrSurface*>(tex1) == tex1->asTexture()); diff --git a/tests/ReadPixelsTest.cpp b/tests/ReadPixelsTest.cpp index 63cc4d0c86..a4683b06ab 100644 --- a/tests/ReadPixelsTest.cpp +++ b/tests/ReadPixelsTest.cpp @@ -318,8 +318,7 @@ DEF_GPUTEST(ReadPixels, reporter, factory) { desc.fHeight = DEV_H; desc.fConfig = kSkia8888_GrPixelConfig; desc.fOrigin = 1 == dtype ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOrigin; - SkAutoTUnref<GrTexture> texture( - context->refScratchTexture(desc, GrContext::kExact_ScratchTexMatch)); + SkAutoTUnref<GrTexture> texture(context->createTexture(desc, false)); surface.reset(SkSurface::NewRenderTargetDirect(texture->asRenderTarget())); #else continue; diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp index 966bc7f901..3f9ff1b480 100644 --- a/tests/ReadWriteAlphaTest.cpp +++ b/tests/ReadWriteAlphaTest.cpp @@ -41,7 +41,7 @@ DEF_GPUTEST(ReadWriteAlpha, reporter, factory) { desc.fHeight = Y_SIZE; // We are initializing the texture with zeros here - GrTexture* texture = context->createUncachedTexture(desc, textureData, 0); + GrTexture* texture = context->createTexture(desc, false, textureData, 0); if (!texture) { return; } diff --git a/tests/RecordReplaceDrawTest.cpp b/tests/RecordReplaceDrawTest.cpp index bbf01686d0..55f47cee6c 100644 --- a/tests/RecordReplaceDrawTest.cpp +++ b/tests/RecordReplaceDrawTest.cpp @@ -124,7 +124,7 @@ void test_replacements(skiatest::Reporter* r, GrContext* context, bool useBBH) { desc.fHeight = kHeight; desc.fSampleCnt = 0; - SkAutoTUnref<GrTexture> texture(context->createUncachedTexture(desc, NULL, 0)); + SkAutoTUnref<GrTexture> texture(context->createTexture(desc, false, NULL, 0)); layer->setTexture(texture, SkIRect::MakeWH(kWidth, kHeight)); SkAutoTUnref<SkBBoxHierarchy> bbh; diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp index 86effad364..2d24a77f35 100644 --- a/tests/WritePixelsTest.cpp +++ b/tests/WritePixelsTest.cpp @@ -319,8 +319,7 @@ static SkSurface* create_surface(const CanvasConfig& c, GrContext* grCtx) { desc.fConfig = kSkia8888_GrPixelConfig; desc.fOrigin = kGpu_TopLeft_DevType == c.fDevType ? kTopLeft_GrSurfaceOrigin : kBottomLeft_GrSurfaceOrigin; - SkAutoTUnref<GrTexture> texture( - grCtx->refScratchTexture(desc, GrContext::kExact_ScratchTexMatch)); + SkAutoTUnref<GrTexture> texture(grCtx->createTexture(desc, false)); return SkSurface::NewRenderTargetDirect(texture->asRenderTarget()); #endif } |