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

Side by Side Diff: tests/GrSurfaceTest.cpp

Issue 1966013002: Turn ContextInfos returned by GrContextFactory into structs. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Address comment Created 4 years, 7 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
« no previous file with comments | « tests/GrPorterDuffTest.cpp ('k') | tests/GrTextureMipMapInvalidationTest.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 #include "SkTypes.h" 8 #include "SkTypes.h"
9 9
10 #if SK_SUPPORT_GPU 10 #if SK_SUPPORT_GPU
11 11
12 #include "GrContext.h" 12 #include "GrContext.h"
13 #include "GrGpu.h" 13 #include "GrGpu.h"
14 #include "GrRenderTarget.h" 14 #include "GrRenderTarget.h"
15 #include "GrTexture.h" 15 #include "GrTexture.h"
16 #include "GrSurfacePriv.h" 16 #include "GrSurfacePriv.h"
17 #include "Test.h" 17 #include "Test.h"
18 18
19 // Tests that GrSurface::asTexture(), GrSurface::asRenderTarget(), and static up casting of texture 19 // Tests that GrSurface::asTexture(), GrSurface::asRenderTarget(), and static up casting of texture
20 // and render targets to GrSurface all work as expected. 20 // and render targets to GrSurface all work as expected.
21 DEF_GPUTEST_FOR_NULLGL_CONTEXT(GrSurface, reporter, ctxInfo) { 21 DEF_GPUTEST_FOR_NULLGL_CONTEXT(GrSurface, reporter, ctxInfo) {
22 GrContext* context = ctxInfo.fGrContext; 22 GrContext* context = ctxInfo.grContext();
23 GrSurfaceDesc desc; 23 GrSurfaceDesc desc;
24 desc.fConfig = kSkia8888_GrPixelConfig; 24 desc.fConfig = kSkia8888_GrPixelConfig;
25 desc.fFlags = kRenderTarget_GrSurfaceFlag; 25 desc.fFlags = kRenderTarget_GrSurfaceFlag;
26 desc.fWidth = 256; 26 desc.fWidth = 256;
27 desc.fHeight = 256; 27 desc.fHeight = 256;
28 desc.fSampleCnt = 0; 28 desc.fSampleCnt = 0;
29 GrSurface* texRT1 = context->textureProvider()->createTexture( 29 GrSurface* texRT1 = context->textureProvider()->createTexture(
30 desc, SkBudgeted::kNo, nullptr, 0); 30 desc, SkBudgeted::kNo, nullptr, 0);
31 31
32 REPORTER_ASSERT(reporter, texRT1 == texRT1->asRenderTarget()); 32 REPORTER_ASSERT(reporter, texRT1 == texRT1->asRenderTarget());
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 REPORTER_ASSERT(reporter, static_cast<GrSurface*>(texRT2->asRenderTarget()) == 65 REPORTER_ASSERT(reporter, static_cast<GrSurface*>(texRT2->asRenderTarget()) ==
66 static_cast<GrSurface*>(texRT2->asTexture())); 66 static_cast<GrSurface*>(texRT2->asTexture()));
67 67
68 texRT1->unref(); 68 texRT1->unref();
69 texRT2->unref(); 69 texRT2->unref();
70 tex1->unref(); 70 tex1->unref();
71 context->getGpu()->deleteTestingOnlyBackendTexture(backendTex); 71 context->getGpu()->deleteTestingOnlyBackendTexture(backendTex);
72 } 72 }
73 73
74 #endif 74 #endif
OLDNEW
« no previous file with comments | « tests/GrPorterDuffTest.cpp ('k') | tests/GrTextureMipMapInvalidationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698