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

Unified Diff: gm/imagetoyuvplanes.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/imagesource2.cpp ('k') | gm/localmatriximagefilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagetoyuvplanes.cpp
diff --git a/gm/imagetoyuvplanes.cpp b/gm/imagetoyuvplanes.cpp
index 87bff8ee64948c241d3737aa927db62c0224d41e..ddead1be42cea4b242f3fd41be2e15569eed1017 100644
--- a/gm/imagetoyuvplanes.cpp
+++ b/gm/imagetoyuvplanes.cpp
@@ -12,7 +12,7 @@
#include "SkGradientShader.h"
#include "SkImage.h"
-static SkImage* create_image(GrContext* context, int width, int height) {
+static sk_sp<SkImage> create_image(GrContext* context, int width, int height) {
SkAutoTUnref<SkSurface> surface;
SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
if (context) {
@@ -33,7 +33,7 @@ static SkImage* create_image(GrContext* context, int width, int height) {
SkShader::kMirror_TileMode));
surface->getCanvas()->drawPaint(paint);
- return surface->newImageSnapshot();
+ return surface->makeImageSnapshot();
}
DEF_SIMPLE_GM(image_to_yuv_planes, canvas, 120, 525) {
@@ -41,12 +41,12 @@ DEF_SIMPLE_GM(image_to_yuv_planes, canvas, 120, 525) {
static const int kImageSize = 32;
GrContext *context = canvas->getGrContext();
- SkAutoTUnref<SkImage> rgbImage(create_image(context, kImageSize, kImageSize));
+ sk_sp<SkImage> rgbImage(create_image(context, kImageSize, kImageSize));
if (!rgbImage) {
return;
}
- canvas->drawImage(rgbImage, kPad, kPad);
+ canvas->drawImage(rgbImage.get(), kPad, kPad);
// Test cases where all three planes are the same size, where just u and v are the same size,
// and where all differ.
static const SkISize kSizes[][3] = {
« no previous file with comments | « gm/imagesource2.cpp ('k') | gm/localmatriximagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698