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

Side by Side Diff: tests/ImageNewShaderTest.cpp

Issue 646213003: Add `SkIRect bounds()` convenience method to SkImageInfo and SkBitmap. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: reed nits Created 6 years, 1 month 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 | « src/pdf/SkPDFDevice.cpp ('k') | tests/WritePixelsTest.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 "SkTypes.h" 8 #include "SkTypes.h"
9 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 #include "GrContextFactory.h" 10 #include "GrContextFactory.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
58 58
59 SkIRect rect = SkIRect::MakeWH(info.width(), info.height()); 59 SkIRect rect = info.bounds();
60 60
61 SkBitmap bmOrig; 61 SkBitmap bmOrig;
62 sourceSurface->getCanvas()->readPixels(rect, &bmOrig); 62 sourceSurface->getCanvas()->readPixels(rect, &bmOrig);
63 63
64 64
65 SkBitmap bm; 65 SkBitmap bm;
66 destinationCanvas->readPixels(rect, &bm); 66 destinationCanvas->readPixels(rect, &bm);
67 67
68 testBitmapEquality(reporter, bmOrig, bm); 68 testBitmapEquality(reporter, bmOrig, bm);
69 69
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 // GPU -> RASTER 159 // GPU -> RASTER
160 gpuToRaster(reporter, context); 160 gpuToRaster(reporter, context);
161 161
162 // RASTER -> GPU 162 // RASTER -> GPU
163 rasterToGpu(reporter, context); 163 rasterToGpu(reporter, context);
164 } 164 }
165 } 165 }
166 166
167 #endif 167 #endif
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | tests/WritePixelsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698