Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: gm/image.cpp

Issue 1815823002: Move SkGLContext and some GrGLInterface implementations to skgputest module (Closed) Base URL: https://chromium.googlesource.com/skia.git@debugobject
Patch Set: fix windows and android? Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | gyp/SampleApp.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | gyp/SampleApp.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698