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

Unified Diff: tests/ImageIsOpaqueTest.cpp

Issue 1448873002: Generate list of GPU contexts outside tests (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-01-gpu-test-context-support
Patch Set: make blurtest for all rendering contexts Created 5 years 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 | « tests/ImageFilterTest.cpp ('k') | tests/ImageNewShaderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageIsOpaqueTest.cpp
diff --git a/tests/ImageIsOpaqueTest.cpp b/tests/ImageIsOpaqueTest.cpp
index 48ac9f94bb0bcd54c4cd6fe633e9b014fe87e974..5d7003f20b9baa13956fd520d59a6bb99cdd502a 100644
--- a/tests/ImageIsOpaqueTest.cpp
+++ b/tests/ImageIsOpaqueTest.cpp
@@ -9,7 +9,7 @@
#include "Test.h"
#if SK_SUPPORT_GPU
-#include "GrContextFactory.h"
+#include "GrContext.h"
#endif
#include "SkImage.h"
#include "SkSurface.h"
@@ -65,31 +65,17 @@ DEF_TEST(ImageIsOpaqueTest, reporter) {
#if SK_SUPPORT_GPU
-DEF_GPUTEST(ImageIsOpaqueTest_GPU, reporter, factory) {
- for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) {
- GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContextType) i;
-
- if (!GrContextFactory::IsRenderingGLContext(glCtxType)) {
- continue;
- }
-
- GrContext* context = factory->get(glCtxType);
-
- if (nullptr == context) {
- continue;
- }
-
- SkImageInfo infoTransparent = SkImageInfo::MakeN32Premul(5, 5);
- SkAutoTUnref<SkSurface> surfaceTransparent(
- SkSurface::NewRenderTarget(context,SkSurface::kNo_Budgeted, infoTransparent));
- check_isopaque(reporter, surfaceTransparent, false);
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageIsOpaqueTest_Gpu, reporter, context) {
+ SkImageInfo infoTransparent = SkImageInfo::MakeN32Premul(5, 5);
+ SkAutoTUnref<SkSurface> surfaceTransparent(
+ SkSurface::NewRenderTarget(context, SkSurface::kNo_Budgeted, infoTransparent));
+ check_isopaque(reporter, surfaceTransparent, false);
- SkImageInfo infoOpaque = SkImageInfo::MakeN32(5, 5, kOpaque_SkAlphaType);
- SkAutoTUnref<SkSurface> surfaceOpaque(
- SkSurface::NewRenderTarget(context,SkSurface::kNo_Budgeted, infoOpaque));
+ SkImageInfo infoOpaque = SkImageInfo::MakeN32(5, 5, kOpaque_SkAlphaType);
+ SkAutoTUnref<SkSurface> surfaceOpaque(
+ SkSurface::NewRenderTarget(context,SkSurface::kNo_Budgeted, infoOpaque));
- check_isopaque(reporter, surfaceOpaque, true);
- }
+ check_isopaque(reporter, surfaceOpaque, true);
}
#endif
« no previous file with comments | « tests/ImageFilterTest.cpp ('k') | tests/ImageNewShaderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698