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

Side by Side Diff: src/image/SkImage.cpp

Issue 925853002: Make SkImage::getTexture() const (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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') | no next file » | 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 2012 Google Inc. 2 * Copyright 2012 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkImageGenerator.h" 10 #include "SkImageGenerator.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 bool SkImage::readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dst RowBytes, 49 bool SkImage::readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dst RowBytes,
50 int srcX, int srcY) const { 50 int srcX, int srcY) const {
51 SkReadPixelsRec rec(dstInfo, dstPixels, dstRowBytes, srcX, srcY); 51 SkReadPixelsRec rec(dstInfo, dstPixels, dstRowBytes, srcX, srcY);
52 if (!rec.trim(this->width(), this->height())) { 52 if (!rec.trim(this->width(), this->height())) {
53 return false; 53 return false;
54 } 54 }
55 return as_IB(this)->onReadPixels(rec.fInfo, rec.fPixels, rec.fRowBytes, rec. fX, rec.fY); 55 return as_IB(this)->onReadPixels(rec.fInfo, rec.fPixels, rec.fRowBytes, rec. fX, rec.fY);
56 } 56 }
57 57
58 GrTexture* SkImage::getTexture() { 58 GrTexture* SkImage::getTexture() const {
59 return as_IB(this)->onGetTexture(); 59 return as_IB(this)->onGetTexture();
60 } 60 }
61 61
62 SkShader* SkImage::newShader(SkShader::TileMode tileX, 62 SkShader* SkImage::newShader(SkShader::TileMode tileX,
63 SkShader::TileMode tileY, 63 SkShader::TileMode tileY,
64 const SkMatrix* localMatrix) const { 64 const SkMatrix* localMatrix) const {
65 return as_IB(this)->onNewShader(tileX, tileY, localMatrix); 65 return as_IB(this)->onNewShader(tileX, tileY, localMatrix);
66 } 66 }
67 67
68 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { 68 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 surface->getCanvas()->translate(-src.x(), -src.y()); 176 surface->getCanvas()->translate(-src.x(), -src.y());
177 177
178 SkPaint paint; 178 SkPaint paint;
179 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 179 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
180 paint.setFilterQuality(quality); 180 paint.setFilterQuality(quality);
181 surface->getCanvas()->drawImage(this, 0, 0, &paint); 181 surface->getCanvas()->drawImage(this, 0, 0, &paint);
182 return surface->newImageSnapshot(); 182 return surface->newImageSnapshot();
183 } 183 }
184 184
185 185
OLDNEW
« no previous file with comments | « include/core/SkImage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698