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

Side by Side Diff: src/core/SkPictureImageGenerator.cpp

Issue 1744243002: Remove internal calls to SkImage::getTexture (Closed) Base URL: https://skia.googlesource.com/skia.git@budalias
Patch Set: Add getTexture() back to SkImage :( 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 unified diff | Download patch
« no previous file with comments | « include/core/SkImage.h ('k') | src/core/SkSpecialImage.cpp » ('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 2015 Google Inc. 2 * Copyright 2015 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 "SkImage_Base.h"
8 #include "SkImageGenerator.h" 9 #include "SkImageGenerator.h"
9 #include "SkCanvas.h" 10 #include "SkCanvas.h"
10 #include "SkMatrix.h" 11 #include "SkMatrix.h"
11 #include "SkPaint.h" 12 #include "SkPaint.h"
12 #include "SkPicture.h" 13 #include "SkPicture.h"
13 #include "SkSurface.h" 14 #include "SkSurface.h"
14 #include "SkTLazy.h" 15 #include "SkTLazy.h"
15 16
16 class SkPictureImageGenerator : SkImageGenerator { 17 class SkPictureImageGenerator : SkImageGenerator {
17 public: 18 public:
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 SkMatrix matrix = fMatrix; 148 SkMatrix matrix = fMatrix;
148 if (subset) { 149 if (subset) {
149 matrix.postTranslate(-subset->x(), -subset->y()); 150 matrix.postTranslate(-subset->x(), -subset->y());
150 } 151 }
151 surface->getCanvas()->clear(0); // does NewRenderTarget promise to do this f or us? 152 surface->getCanvas()->clear(0); // does NewRenderTarget promise to do this f or us?
152 surface->getCanvas()->drawPicture(fPicture, &matrix, fPaint.getMaybeNull()); 153 surface->getCanvas()->drawPicture(fPicture, &matrix, fPaint.getMaybeNull());
153 SkAutoTUnref<SkImage> image(surface->newImageSnapshot()); 154 SkAutoTUnref<SkImage> image(surface->newImageSnapshot());
154 if (!image.get()) { 155 if (!image.get()) {
155 return nullptr; 156 return nullptr;
156 } 157 }
157 return SkSafeRef(image->getTexture()); 158 return SkSafeRef(as_IB(image)->peekTexture());
158 } 159 }
159 #endif 160 #endif
OLDNEW
« no previous file with comments | « include/core/SkImage.h ('k') | src/core/SkSpecialImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698