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

Side by Side Diff: gm/surface.cpp

Issue 1364443002: remove unused (by the outside) SkImage::newSurface, and simplify newImage -> newSubset (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 | « gm/image_pict.cpp ('k') | include/core/SkImage.h » ('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 2014 Google Inc. 2 * Copyright 2014 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 "gm.h" 8 #include "gm.h"
9 #include "SkGradientShader.h" 9 #include "SkGradientShader.h"
10 #include "SkSurface.h" 10 #include "SkSurface.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 SkAutoTUnref<SkSurface> surf(canvas->newSurface(info, nullptr)); 137 SkAutoTUnref<SkSurface> surf(canvas->newSurface(info, nullptr));
138 if (!surf.get()) { 138 if (!surf.get()) {
139 surf.reset(SkSurface::NewRaster(info)); 139 surf.reset(SkSurface::NewRaster(info));
140 } 140 }
141 drawInto(surf->getCanvas()); 141 drawInto(surf->getCanvas());
142 142
143 SkAutoTUnref<SkImage> image(surf->newImageSnapshot()); 143 SkAutoTUnref<SkImage> image(surf->newImageSnapshot());
144 canvas->drawImage(image, 10, 10, nullptr); 144 canvas->drawImage(image, 10, 10, nullptr);
145 145
146 SkAutoTUnref<SkSurface> surf2(image->newSurface(info, nullptr)); 146 SkAutoTUnref<SkSurface> surf2(surf->newSurface(info));
147 drawInto(surf2->getCanvas()); 147 drawInto(surf2->getCanvas());
148 148
149 // Assert that the props were communicated transitively through the firs t image 149 // Assert that the props were communicated transitively through the firs t image
150 SkASSERT(equal(surf->props(), surf2->props())); 150 SkASSERT(equal(surf->props(), surf2->props()));
151 151
152 SkAutoTUnref<SkImage> image2(surf2->newImageSnapshot()); 152 SkAutoTUnref<SkImage> image2(surf2->newImageSnapshot());
153 canvas->drawImage(image2, 10 + SkIntToScalar(image->width()) + 10, 10, n ullptr); 153 canvas->drawImage(image2, 10 + SkIntToScalar(image->width()) + 10, 10, n ullptr);
154 } 154 }
155 155
156 private: 156 private:
157 typedef GM INHERITED; 157 typedef GM INHERITED;
158 }; 158 };
159 DEF_GM( return new NewSurfaceGM ) 159 DEF_GM( return new NewSurfaceGM )
160 160
OLDNEW
« no previous file with comments | « gm/image_pict.cpp ('k') | include/core/SkImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698