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