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

Unified Diff: tests/GrTextureMipMapInvalidationTest.cpp

Issue 1249543003: Creating functions for uploading a mipmapped texture. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Removing the concept of a dirty mipmap. It is expected that the texture upload provides the mipmaps. Created 5 years, 3 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
« src/gpu/gl/GrGLGpu.cpp ('K') | « src/image/SkImage_Gpu.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GrTextureMipMapInvalidationTest.cpp
diff --git a/tests/GrTextureMipMapInvalidationTest.cpp b/tests/GrTextureMipMapInvalidationTest.cpp
deleted file mode 100644
index f046f8ff6b120186c47edbed50911288c2fd8aaf..0000000000000000000000000000000000000000
--- a/tests/GrTextureMipMapInvalidationTest.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2013 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkTypes.h"
-
-#if SK_SUPPORT_GPU
-
-#include "GrContext.h"
-#include "GrContextFactory.h"
-#include "GrTexture.h"
-#include "GrTexturePriv.h"
-#include "SkCanvas.h"
-#include "SkGr.h"
-#include "SkSurface.h"
-#include "Test.h"
-
-// Tests that GrSurface::asTexture(), GrSurface::asRenderTarget(), and static upcasting of texture
-// and render targets to GrSurface all work as expected.
-DEF_GPUTEST(GrTextureMipMapInvalidationTest, reporter, factory) {
- GrContext* context = factory->get(GrContextFactory::kNull_GLContextType);
- if (context) {
- GrSurfaceDesc desc;
- desc.fConfig = kSkia8888_GrPixelConfig;
- desc.fFlags = kRenderTarget_GrSurfaceFlag;
- desc.fWidth = 256;
- desc.fHeight = 256;
- desc.fSampleCnt = 0;
- GrSurface* texRT1 = context->textureProvider()->createTexture(desc, false, nullptr, 0);
- GrSurface* texRT2 = context->textureProvider()->createTexture(desc, false, nullptr, 0);
- REPORTER_ASSERT(reporter, nullptr != texRT1);
- REPORTER_ASSERT(reporter, nullptr != texRT2);
- GrTexture* tex = texRT1->asTexture();
- REPORTER_ASSERT(reporter, nullptr != tex);
- SkBitmap bitmap;
- GrWrapTextureInBitmap(tex, 256, 256, false, &bitmap);
-
- // No mipmaps initially
- REPORTER_ASSERT(reporter, false == tex->texturePriv().hasMipMaps());
-
- // Painting with downscale and medium filter quality should result in mipmap creation
bsalomon 2015/09/15 13:14:10 This still has to work...
- SkSurface* surface = SkSurface::NewRenderTargetDirect(texRT2->asRenderTarget());
- SkPaint paint;
- paint.setFilterQuality(kMedium_SkFilterQuality);
- surface->getCanvas()->scale(0.2f, 0.2f);
- surface->getCanvas()->drawBitmap(bitmap, 0, 0, &paint);
- context->flush();
-
- REPORTER_ASSERT(reporter, true == tex->texturePriv().hasMipMaps());
- REPORTER_ASSERT(reporter, false == tex->texturePriv().mipMapsAreDirty());
-
- // Invalidating the contents of the bitmap should invalidate the mipmap, but not de-allocate
- bitmap.notifyPixelsChanged();
- REPORTER_ASSERT(reporter, true == tex->texturePriv().hasMipMaps());
- REPORTER_ASSERT(reporter, true == tex->texturePriv().mipMapsAreDirty());
-
- surface->unref();
- texRT1->unref();
- texRT2->unref();
- }
-}
-
-#endif
« src/gpu/gl/GrGLGpu.cpp ('K') | « src/image/SkImage_Gpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698