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 26 matching lines...) Expand all Loading... |
37 SkIntToScalar(0), | 37 SkIntToScalar(0), |
38 SkIntToScalar(1), | 38 SkIntToScalar(1), |
39 SkIntToScalar(sourceSurface->height())); | 39 SkIntToScalar(sourceSurface->height())); |
40 | 40 |
41 sourceCanvas->drawRect(rect, paintColor); | 41 sourceCanvas->drawRect(rect, paintColor); |
42 } | 42 } |
43 | 43 |
44 void runShaderTest(skiatest::Reporter* reporter, SkSurface* sourceSurface, SkSur
face* destinationSurface, SkImageInfo& info) { | 44 void runShaderTest(skiatest::Reporter* reporter, SkSurface* sourceSurface, SkSur
face* destinationSurface, SkImageInfo& info) { |
45 paintSource(sourceSurface); | 45 paintSource(sourceSurface); |
46 | 46 |
47 SkAutoTUnref<SkImage> sourceImage(sourceSurface->newImageSnapshot()); | 47 sk_sp<SkImage> sourceImage(sourceSurface->makeImageSnapshot()); |
48 sk_sp<SkShader> sourceShader = sourceImage->makeShader( | 48 sk_sp<SkShader> sourceShader = sourceImage->makeShader( |
49 SkShader::kRepeat_TileMode, | 49 SkShader::kRepeat_TileMode, |
50 SkShader::kRepeat_TileMode); | 50 SkShader::kRepeat_TileMode); |
51 | 51 |
52 SkPaint paint; | 52 SkPaint paint; |
53 paint.setShader(sourceShader); | 53 paint.setShader(sourceShader); |
54 | 54 |
55 SkCanvas* destinationCanvas = destinationSurface->getCanvas(); | 55 SkCanvas* destinationCanvas = destinationSurface->getCanvas(); |
56 destinationCanvas->clear(SK_ColorTRANSPARENT); | 56 destinationCanvas->clear(SK_ColorTRANSPARENT); |
57 destinationCanvas->drawPaint(paint); | 57 destinationCanvas->drawPaint(paint); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |