| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |