| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkCommandLineFlags.h" | 10 #include "SkCommandLineFlags.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 setup_bitmap(&bitmap, (int)SkScalarToDouble(width), (int)SkScalarToDoubl
e(height), | 163 setup_bitmap(&bitmap, (int)SkScalarToDouble(width), (int)SkScalarToDoubl
e(height), |
| 164 background); | 164 background); |
| 165 #endif | 165 #endif |
| 166 SkAutoTUnref<SkBaseDevice> device; | 166 SkAutoTUnref<SkBaseDevice> device; |
| 167 if (strcmp(FLAGS_config[0], "8888") == 0) { | 167 if (strcmp(FLAGS_config[0], "8888") == 0) { |
| 168 device.reset(SkNEW_ARGS(SkBitmapDevice, (bitmap))); | 168 device.reset(SkNEW_ARGS(SkBitmapDevice, (bitmap))); |
| 169 } | 169 } |
| 170 #if SK_SUPPORT_GPU | 170 #if SK_SUPPORT_GPU |
| 171 else if (strcmp(FLAGS_config[0], "gpu") == 0) { | 171 else if (strcmp(FLAGS_config[0], "gpu") == 0) { |
| 172 SkAutoTUnref<GrSurface> target; | 172 SkAutoTUnref<GrSurface> target; |
| 173 GrContext* gr = gContextFactory.get(GrContextFactory::kNative_GLCont
extType); | 173 GrContext* gr = gContextFactory.get(GrContextFactory::kNative_GLCont
extType, |
| 174 kNone_GrGLStandard); |
| 174 if (gr) { | 175 if (gr) { |
| 175 // create a render target to back the device | 176 // create a render target to back the device |
| 176 GrTextureDesc desc; | 177 GrTextureDesc desc; |
| 177 desc.fConfig = kSkia8888_GrPixelConfig; | 178 desc.fConfig = kSkia8888_GrPixelConfig; |
| 178 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 179 desc.fFlags = kRenderTarget_GrTextureFlagBit; |
| 179 desc.fWidth = SkScalarCeilToInt(width); | 180 desc.fWidth = SkScalarCeilToInt(width); |
| 180 desc.fHeight = SkScalarCeilToInt(height); | 181 desc.fHeight = SkScalarCeilToInt(height); |
| 181 desc.fSampleCnt = 0; | 182 desc.fSampleCnt = 0; |
| 182 target.reset(gr->createUncachedTexture(desc, NULL, 0)); | 183 target.reset(gr->createUncachedTexture(desc, NULL, 0)); |
| 183 } | 184 } |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 } | 343 } |
| 343 | 344 |
| 344 return 0; | 345 return 0; |
| 345 } | 346 } |
| 346 | 347 |
| 347 #if !defined SK_BUILD_FOR_IOS | 348 #if !defined SK_BUILD_FOR_IOS |
| 348 int main(int argc, char * const argv[]) { | 349 int main(int argc, char * const argv[]) { |
| 349 return tool_main(argc, (char**) argv); | 350 return tool_main(argc, (char**) argv); |
| 350 } | 351 } |
| 351 #endif | 352 #endif |
| OLD | NEW |