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

Side by Side Diff: tests/GrSurfaceTest.cpp

Issue 132293005: Add a DEF_GPUTEST() macro. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fatory -> factory Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/GrDrawTargetTest.cpp ('k') | tests/PremulAlphaRoundTripTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1
2 /* 1 /*
3 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
4 * 3 *
5 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 5 * found in the LICENSE file.
7 */ 6 */
8 7
9 // This is a GPU-backend specific test.
10
11 #include "SkTypes.h"
12
13 #if SK_SUPPORT_GPU 8 #if SK_SUPPORT_GPU
14 9
15 #include "Test.h"
16 #include "GrContext.h" 10 #include "GrContext.h"
17 #include "GrContextFactory.h" 11 #include "GrContextFactory.h"
18 #include "GrRenderTarget.h" 12 #include "GrRenderTarget.h"
19 #include "GrTexture.h" 13 #include "GrTexture.h"
14 #include "SkTypes.h"
15 #include "Test.h"
16 #include "TestClassDef.h"
20 17
21 static void GrSurfaceIsSameTest(skiatest::Reporter* reporter, GrContextFactory* factory) { 18 DEF_GPUTEST(GrSurfaceTest, reporter, factory) {
22 GrContext* context = factory->get(GrContextFactory::kNull_GLContextType); 19 GrContext* context = factory->get(GrContextFactory::kNull_GLContextType);
23 if (NULL != context) { 20 if (NULL != context) {
24 GrTextureDesc desc; 21 GrTextureDesc desc;
25 desc.fConfig = kSkia8888_GrPixelConfig; 22 desc.fConfig = kSkia8888_GrPixelConfig;
26 desc.fFlags = kRenderTarget_GrTextureFlagBit; 23 desc.fFlags = kRenderTarget_GrTextureFlagBit;
27 desc.fWidth = 256; 24 desc.fWidth = 256;
28 desc.fHeight = 256; 25 desc.fHeight = 256;
29 desc.fSampleCnt = 0; 26 desc.fSampleCnt = 0;
30 GrSurface* texRT1 = context->createUncachedTexture(desc, NULL, 0); 27 GrSurface* texRT1 = context->createUncachedTexture(desc, NULL, 0);
31 GrSurface* texRT2 = context->createUncachedTexture(desc, NULL, 0); 28 GrSurface* texRT2 = context->createUncachedTexture(desc, NULL, 0);
(...skipping 23 matching lines...) Expand all
55 REPORTER_ASSERT(reporter, !externalTexRT->isSameAs(texRT1)); 52 REPORTER_ASSERT(reporter, !externalTexRT->isSameAs(texRT1));
56 REPORTER_ASSERT(reporter, !externalTexRT->asRenderTarget()->isSameAs(tex RT1)); 53 REPORTER_ASSERT(reporter, !externalTexRT->asRenderTarget()->isSameAs(tex RT1));
57 54
58 texRT1->unref(); 55 texRT1->unref();
59 texRT2->unref(); 56 texRT2->unref();
60 tex1->unref(); 57 tex1->unref();
61 externalTexRT->unref(); 58 externalTexRT->unref();
62 } 59 }
63 } 60 }
64 61
65 #include "TestClassDef.h"
66 DEFINE_GPUTESTCLASS("GrSurfaceIsSame", GrSurfaceIsSameTestClass, GrSurfaceIsSame Test)
67
68 #endif 62 #endif
OLDNEW
« no previous file with comments | « tests/GrDrawTargetTest.cpp ('k') | tests/PremulAlphaRoundTripTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698