| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "BenchTimer.h" | 10 #include "BenchTimer.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 static SkDevice* make_device(SkBitmap::Config config, const SkIPoint& size, | 196 static SkDevice* make_device(SkBitmap::Config config, const SkIPoint& size, |
| 197 Backend backend, int sampleCount, GrContext* contex
t) { | 197 Backend backend, int sampleCount, GrContext* contex
t) { |
| 198 SkDevice* device = NULL; | 198 SkDevice* device = NULL; |
| 199 SkBitmap bitmap; | 199 SkBitmap bitmap; |
| 200 bitmap.setConfig(config, size.fX, size.fY); | 200 bitmap.setConfig(config, size.fX, size.fY); |
| 201 | 201 |
| 202 switch (backend) { | 202 switch (backend) { |
| 203 case kRaster_Backend: | 203 case kRaster_Backend: |
| 204 bitmap.allocPixels(); | 204 bitmap.allocPixels(); |
| 205 erase(bitmap); | 205 erase(bitmap); |
| 206 device = SkNEW_ARGS(SkDevice, (bitmap)); | 206 device = SkNEW_ARGS(SkRasterDevice, (bitmap)); |
| 207 break; | 207 break; |
| 208 #if SK_SUPPORT_GPU | 208 #if SK_SUPPORT_GPU |
| 209 case kGPU_Backend: { | 209 case kGPU_Backend: { |
| 210 GrTextureDesc desc; | 210 GrTextureDesc desc; |
| 211 desc.fConfig = kSkia8888_GrPixelConfig; | 211 desc.fConfig = kSkia8888_GrPixelConfig; |
| 212 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 212 desc.fFlags = kRenderTarget_GrTextureFlagBit; |
| 213 desc.fWidth = size.fX; | 213 desc.fWidth = size.fX; |
| 214 desc.fHeight = size.fY; | 214 desc.fHeight = size.fY; |
| 215 desc.fSampleCnt = sampleCount; | 215 desc.fSampleCnt = sampleCount; |
| 216 SkAutoTUnref<GrTexture> texture(context->createUncachedTexture(desc,
NULL, 0)); | 216 SkAutoTUnref<GrTexture> texture(context->createUncachedTexture(desc,
NULL, 0)); |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 } | 966 } |
| 967 | 967 |
| 968 return 0; | 968 return 0; |
| 969 } | 969 } |
| 970 | 970 |
| 971 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 971 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 972 int main(int argc, char * const argv[]) { | 972 int main(int argc, char * const argv[]) { |
| 973 return tool_main(argc, (char**) argv); | 973 return tool_main(argc, (char**) argv); |
| 974 } | 974 } |
| 975 #endif | 975 #endif |
| OLD | NEW |