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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkData.h" | 9 #include "SkData.h" |
10 #include "SkImageEncoder.h" | 10 #include "SkImageEncoder.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 { kGpu_ImageType, false, "Gpu" }, | 244 { kGpu_ImageType, false, "Gpu" }, |
245 { kCodec_ImageType, false, "Codec" }, | 245 { kCodec_ImageType, false, "Codec" }, |
246 }; | 246 }; |
247 | 247 |
248 const SkColor color = SK_ColorRED; | 248 const SkColor color = SK_ColorRED; |
249 const SkPMColor pmcolor = SkPreMultiplyColor(color); | 249 const SkPMColor pmcolor = SkPreMultiplyColor(color); |
250 | 250 |
251 GrContext* ctx = NULL; | 251 GrContext* ctx = NULL; |
252 #if SK_SUPPORT_GPU | 252 #if SK_SUPPORT_GPU |
253 ctx = factory->get(GrContextFactory::kNative_GLContextType); | 253 ctx = factory->get(GrContextFactory::kNative_GLContextType); |
254 if (!ctx) { | 254 if (NULL == ctx) { |
255 return; | 255 return; |
256 } | 256 } |
257 #endif | 257 #endif |
258 | 258 |
259 for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); ++i) { | 259 for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); ++i) { |
260 SkImageInfo info; | 260 SkImageInfo info; |
261 size_t rowBytes; | 261 size_t rowBytes; |
262 | 262 |
263 SkAutoTUnref<SkImage> image(createImage(gRec[i].fType, ctx, color)); | 263 SkAutoTUnref<SkImage> image(createImage(gRec[i].fType, ctx, color)); |
264 if (!image.get()) { | 264 if (!image.get()) { |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 TestGetTexture(reporter, kGpu_SurfaceType, context); | 610 TestGetTexture(reporter, kGpu_SurfaceType, context); |
611 TestGetTexture(reporter, kGpuScratch_SurfaceType, context); | 611 TestGetTexture(reporter, kGpuScratch_SurfaceType, context); |
612 test_empty_surface(reporter, context); | 612 test_empty_surface(reporter, context); |
613 test_surface_budget(reporter, context); | 613 test_surface_budget(reporter, context); |
614 test_wrapped_texture_surface(reporter, context); | 614 test_wrapped_texture_surface(reporter, context); |
615 } | 615 } |
616 } | 616 } |
617 } | 617 } |
618 #endif | 618 #endif |
619 } | 619 } |
OLD | NEW |