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

Side by Side Diff: tests/GrSurfaceTest.cpp

Issue 682223002: rename GrTextureDesc->GrSurfaceDesc, GrTextureFlags->GrSurfaceFlags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: const Created 6 years, 1 month 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
« no previous file with comments | « tests/GpuLayerCacheTest.cpp ('k') | tests/ReadPixelsTest.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 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * 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
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #if SK_SUPPORT_GPU 8 #if SK_SUPPORT_GPU
9 9
10 #include "GrContext.h" 10 #include "GrContext.h"
11 #include "GrContextFactory.h" 11 #include "GrContextFactory.h"
12 #include "GrRenderTarget.h" 12 #include "GrRenderTarget.h"
13 #include "GrTexture.h" 13 #include "GrTexture.h"
14 #include "GrSurfacePriv.h" 14 #include "GrSurfacePriv.h"
15 #include "SkTypes.h" 15 #include "SkTypes.h"
16 #include "Test.h" 16 #include "Test.h"
17 17
18 DEF_GPUTEST(GrSurface, reporter, factory) { 18 DEF_GPUTEST(GrSurface, reporter, factory) {
19 GrContext* context = factory->get(GrContextFactory::kNull_GLContextType); 19 GrContext* context = factory->get(GrContextFactory::kNull_GLContextType);
20 if (context) { 20 if (context) {
21 GrTextureDesc desc; 21 GrSurfaceDesc desc;
22 desc.fConfig = kSkia8888_GrPixelConfig; 22 desc.fConfig = kSkia8888_GrPixelConfig;
23 desc.fFlags = kRenderTarget_GrTextureFlagBit; 23 desc.fFlags = kRenderTarget_GrSurfaceFlag;
24 desc.fWidth = 256; 24 desc.fWidth = 256;
25 desc.fHeight = 256; 25 desc.fHeight = 256;
26 desc.fSampleCnt = 0; 26 desc.fSampleCnt = 0;
27 GrSurface* texRT1 = context->createUncachedTexture(desc, NULL, 0); 27 GrSurface* texRT1 = context->createUncachedTexture(desc, NULL, 0);
28 GrSurface* texRT2 = context->createUncachedTexture(desc, NULL, 0); 28 GrSurface* texRT2 = context->createUncachedTexture(desc, NULL, 0);
29 desc.fFlags = kNone_GrTextureFlags; 29 desc.fFlags = kNone_GrSurfaceFlags;
30 GrSurface* tex1 = context->createUncachedTexture(desc, NULL, 0); 30 GrSurface* tex1 = context->createUncachedTexture(desc, NULL, 0);
31 31
32 REPORTER_ASSERT(reporter, texRT1->surfacePriv().isSameAs(texRT1)); 32 REPORTER_ASSERT(reporter, texRT1->surfacePriv().isSameAs(texRT1));
33 REPORTER_ASSERT(reporter, texRT1->surfacePriv().isSameAs(texRT1->asRende rTarget())); 33 REPORTER_ASSERT(reporter, texRT1->surfacePriv().isSameAs(texRT1->asRende rTarget()));
34 REPORTER_ASSERT(reporter, texRT1->asRenderTarget()->surfacePriv().isSame As(texRT1)); 34 REPORTER_ASSERT(reporter, texRT1->asRenderTarget()->surfacePriv().isSame As(texRT1));
35 REPORTER_ASSERT(reporter, !texRT2->surfacePriv().isSameAs(texRT1)); 35 REPORTER_ASSERT(reporter, !texRT2->surfacePriv().isSameAs(texRT1));
36 REPORTER_ASSERT(reporter, !texRT2->asRenderTarget()->surfacePriv().isSam eAs(texRT1)); 36 REPORTER_ASSERT(reporter, !texRT2->asRenderTarget()->surfacePriv().isSam eAs(texRT1));
37 REPORTER_ASSERT(reporter, !texRT2->surfacePriv().isSameAs(texRT1->asRend erTarget())); 37 REPORTER_ASSERT(reporter, !texRT2->surfacePriv().isSameAs(texRT1->asRend erTarget()));
38 REPORTER_ASSERT(reporter, !texRT2->surfacePriv().isSameAs(tex1)); 38 REPORTER_ASSERT(reporter, !texRT2->surfacePriv().isSameAs(tex1));
39 REPORTER_ASSERT(reporter, !texRT2->asRenderTarget()->surfacePriv().isSam eAs(tex1)); 39 REPORTER_ASSERT(reporter, !texRT2->asRenderTarget()->surfacePriv().isSam eAs(tex1));
(...skipping 15 matching lines...) Expand all
55 REPORTER_ASSERT(reporter, !externalTexRT->asRenderTarget()->surfacePriv( ).isSameAs(texRT1)); 55 REPORTER_ASSERT(reporter, !externalTexRT->asRenderTarget()->surfacePriv( ).isSameAs(texRT1));
56 56
57 texRT1->unref(); 57 texRT1->unref();
58 texRT2->unref(); 58 texRT2->unref();
59 tex1->unref(); 59 tex1->unref();
60 externalTexRT->unref(); 60 externalTexRT->unref();
61 } 61 }
62 } 62 }
63 63
64 #endif 64 #endif
OLDNEW
« no previous file with comments | « tests/GpuLayerCacheTest.cpp ('k') | tests/ReadPixelsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698