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