| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkImage.h" | 9 #include "SkImage.h" |
| 10 #include "SkShader.h" | 10 #include "SkShader.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info)
; | 110 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info)
; |
| 111 } | 111 } |
| 112 | 112 |
| 113 #if SK_SUPPORT_GPU | 113 #if SK_SUPPORT_GPU |
| 114 | 114 |
| 115 void gpuToGpu(skiatest::Reporter* reporter, GrContext* context) { | 115 void gpuToGpu(skiatest::Reporter* reporter, GrContext* context) { |
| 116 SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5); | 116 SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5); |
| 117 | 117 |
| 118 SkAutoTUnref<SkSurface> sourceSurface( | 118 SkAutoTUnref<SkSurface> sourceSurface( |
| 119 SkSurface::NewRenderTarget(context, SkBudgeted::kNo, info)); | 119 SkSurface::NewRenderTarget(context, SkSurface::kNo_Budgeted, info)); |
| 120 SkAutoTUnref<SkSurface> destinationSurface( | 120 SkAutoTUnref<SkSurface> destinationSurface( |
| 121 SkSurface::NewRenderTarget(context, SkBudgeted::kNo, info)); | 121 SkSurface::NewRenderTarget(context, SkSurface::kNo_Budgeted, info)); |
| 122 | 122 |
| 123 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info)
; | 123 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info)
; |
| 124 } | 124 } |
| 125 | 125 |
| 126 void gpuToRaster(skiatest::Reporter* reporter, GrContext* context) { | 126 void gpuToRaster(skiatest::Reporter* reporter, GrContext* context) { |
| 127 SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5); | 127 SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5); |
| 128 | 128 |
| 129 SkAutoTUnref<SkSurface> sourceSurface(SkSurface::NewRenderTarget(context, | 129 SkAutoTUnref<SkSurface> sourceSurface(SkSurface::NewRenderTarget(context, |
| 130 SkBudgeted::kNo, info)); | 130 SkSurface::kNo_Budgeted, info)); |
| 131 SkAutoTUnref<SkSurface> destinationSurface(SkSurface::NewRaster(info)); | 131 SkAutoTUnref<SkSurface> destinationSurface(SkSurface::NewRaster(info)); |
| 132 | 132 |
| 133 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info)
; | 133 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info)
; |
| 134 } | 134 } |
| 135 | 135 |
| 136 void rasterToGpu(skiatest::Reporter* reporter, GrContext* context) { | 136 void rasterToGpu(skiatest::Reporter* reporter, GrContext* context) { |
| 137 SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5); | 137 SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5); |
| 138 | 138 |
| 139 SkAutoTUnref<SkSurface> sourceSurface(SkSurface::NewRaster(info)); | 139 SkAutoTUnref<SkSurface> sourceSurface(SkSurface::NewRaster(info)); |
| 140 SkAutoTUnref<SkSurface> destinationSurface(SkSurface::NewRenderTarget(contex
t, | 140 SkAutoTUnref<SkSurface> destinationSurface(SkSurface::NewRenderTarget(contex
t, |
| 141 SkBudgeted::kNo, info)); | 141 SkSurface::kNo_Budgeted, info)); |
| 142 | 142 |
| 143 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info)
; | 143 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info)
; |
| 144 } | 144 } |
| 145 | 145 |
| 146 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageNewShader_GPU, reporter, context) { | 146 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageNewShader_GPU, reporter, context) { |
| 147 // GPU -> GPU | 147 // GPU -> GPU |
| 148 gpuToGpu(reporter, context); | 148 gpuToGpu(reporter, context); |
| 149 | 149 |
| 150 // GPU -> RASTER | 150 // GPU -> RASTER |
| 151 gpuToRaster(reporter, context); | 151 gpuToRaster(reporter, context); |
| 152 | 152 |
| 153 // RASTER -> GPU | 153 // RASTER -> GPU |
| 154 rasterToGpu(reporter, context); | 154 rasterToGpu(reporter, context); |
| 155 } | 155 } |
| 156 | 156 |
| 157 #endif | 157 #endif |
| OLD | NEW |