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

Side by Side Diff: tests/ImageNewShaderTest.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage Created 4 years, 9 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/ImageIsOpaqueTest.cpp ('k') | tests/ImageTest.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 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
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
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
OLDNEW
« no previous file with comments | « tests/ImageIsOpaqueTest.cpp ('k') | tests/ImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698