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

Side by Side Diff: tests/SurfaceTest.cpp

Issue 1107973004: Pull cache out of GrContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixpicturerenderer.cpp Created 5 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/ResourceCacheTest.cpp ('k') | tests/TessellatingPathRendererTests.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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkImageEncoder.h" 10 #include "SkImageEncoder.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 // Test the wrapped factory for SkSurface by creating a texture using ctx an d then treat it as 98 // Test the wrapped factory for SkSurface by creating a texture using ctx an d then treat it as
99 // an external texture and wrap it in a SkSurface. 99 // an external texture and wrap it in a SkSurface.
100 100
101 GrSurfaceDesc texDesc; 101 GrSurfaceDesc texDesc;
102 texDesc.fConfig = kRGBA_8888_GrPixelConfig; 102 texDesc.fConfig = kRGBA_8888_GrPixelConfig;
103 texDesc.fFlags = kRenderTarget_GrSurfaceFlag; 103 texDesc.fFlags = kRenderTarget_GrSurfaceFlag;
104 texDesc.fWidth = texDesc.fHeight = 100; 104 texDesc.fWidth = texDesc.fHeight = 100;
105 texDesc.fSampleCnt = 0; 105 texDesc.fSampleCnt = 0;
106 texDesc.fOrigin = kTopLeft_GrSurfaceOrigin; 106 texDesc.fOrigin = kTopLeft_GrSurfaceOrigin;
107 SkAutoTUnref<GrSurface> dummySurface(ctx->createTexture(texDesc, false)); 107 SkAutoTUnref<GrSurface> dummySurface(ctx->textureProvider()->createTexture(t exDesc, false));
108 108
109 REPORTER_ASSERT(reporter, dummySurface && dummySurface->asTexture() && 109 REPORTER_ASSERT(reporter, dummySurface && dummySurface->asTexture() &&
110 dummySurface->asRenderTarget()); 110 dummySurface->asRenderTarget());
111 if (!dummySurface || !dummySurface->asTexture() || !dummySurface->asRenderTa rget()) { 111 if (!dummySurface || !dummySurface->asTexture() || !dummySurface->asRenderTa rget()) {
112 return; 112 return;
113 } 113 }
114 114
115 GrBackendObject textureHandle = dummySurface->asTexture()->getTextureHandle( ); 115 GrBackendObject textureHandle = dummySurface->asTexture()->getTextureHandle( );
116 116
117 GrBackendTextureDesc wrappedDesc; 117 GrBackendTextureDesc wrappedDesc;
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 TestGetTexture(reporter, kGpu_SurfaceType, context); 610 TestGetTexture(reporter, kGpu_SurfaceType, context);
611 TestGetTexture(reporter, kGpuScratch_SurfaceType, context); 611 TestGetTexture(reporter, kGpuScratch_SurfaceType, context);
612 test_empty_surface(reporter, context); 612 test_empty_surface(reporter, context);
613 test_surface_budget(reporter, context); 613 test_surface_budget(reporter, context);
614 test_wrapped_texture_surface(reporter, context); 614 test_wrapped_texture_surface(reporter, context);
615 } 615 }
616 } 616 }
617 } 617 }
618 #endif 618 #endif
619 } 619 }
OLDNEW
« no previous file with comments | « tests/ResourceCacheTest.cpp ('k') | tests/TessellatingPathRendererTests.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698