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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 make_codec, make_raster, make_picture, make_codec, make_gpu, | 284 make_codec, make_raster, make_picture, make_codec, make_gpu, |
285 }; | 285 }; |
286 for (auto& proc : procs) { | 286 for (auto& proc : procs) { |
287 sk_sp<SkImage> image(proc(info, canvas->getGrContext(), draw_content
s)); | 287 sk_sp<SkImage> image(proc(info, canvas->getGrContext(), draw_content
s)); |
288 if (image) { | 288 if (image) { |
289 show_scaled_pixels(canvas, image.get()); | 289 show_scaled_pixels(canvas, image.get()); |
290 } | 290 } |
291 canvas->translate(0, 120); | 291 canvas->translate(0, 120); |
292 } | 292 } |
293 } | 293 } |
294 | 294 |
295 private: | 295 private: |
296 typedef skiagm::GM INHERITED; | 296 typedef skiagm::GM INHERITED; |
297 }; | 297 }; |
298 DEF_GM( return new ScalePixelsGM; ) | 298 DEF_GM( return new ScalePixelsGM; ) |
299 | 299 |
300 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 300 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
301 | 301 |
302 #include "SkImageGenerator.h" | 302 #include "SkImageGenerator.h" |
303 | 303 |
304 static SkImageInfo make_info(SkImage* img) { | 304 static SkImageInfo make_info(SkImage* img) { |
(...skipping 195 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 |