OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 <functional> | 8 #include <functional> |
9 #include "gm.h" | 9 #include "gm.h" |
10 #include "SkAutoPixmapStorage.h" | 10 #include "SkAutoPixmapStorage.h" |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 DEF_GM( return new ScaleGeneratorGM; ) | 426 DEF_GM( return new ScaleGeneratorGM; ) |
427 | 427 |
428 #if SK_SUPPORT_GPU | 428 #if SK_SUPPORT_GPU |
429 #include "GrContextFactory.h" | 429 #include "GrContextFactory.h" |
430 #endif | 430 #endif |
431 | 431 |
432 DEF_SIMPLE_GM(new_texture_image, canvas, 225, 60) { | 432 DEF_SIMPLE_GM(new_texture_image, canvas, 225, 60) { |
433 GrContext* context = nullptr; | 433 GrContext* context = nullptr; |
434 #if SK_SUPPORT_GPU | 434 #if SK_SUPPORT_GPU |
435 context = canvas->getGrContext(); | 435 context = canvas->getGrContext(); |
436 GrContextFactory factory; | 436 sk_gpu_test::GrContextFactory factory; |
437 #endif | 437 #endif |
438 if (!context) { | 438 if (!context) { |
439 skiagm::GM::DrawGpuOnlyMessage(canvas); | 439 skiagm::GM::DrawGpuOnlyMessage(canvas); |
440 return; | 440 return; |
441 } | 441 } |
442 | 442 |
443 auto render_image = [](SkCanvas* canvas) { | 443 auto render_image = [](SkCanvas* canvas) { |
444 canvas->clear(SK_ColorBLUE); | 444 canvas->clear(SK_ColorBLUE); |
445 SkPaint paint; | 445 SkPaint paint; |
446 paint.setColor(SK_ColorRED); | 446 paint.setColor(SK_ColorRED); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 } | 500 } |
501 if (context) { | 501 if (context) { |
502 sk_sp<SkImage> texImage(image->makeTextureImage(context)); | 502 sk_sp<SkImage> texImage(image->makeTextureImage(context)); |
503 if (texImage) { | 503 if (texImage) { |
504 canvas->drawImage(texImage, 0, 0); | 504 canvas->drawImage(texImage, 0, 0); |
505 } | 505 } |
506 } | 506 } |
507 canvas->translate(image->width() + kPad, 0); | 507 canvas->translate(image->width() + kPad, 0); |
508 } | 508 } |
509 } | 509 } |
OLD | NEW |