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

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

Issue 409653003: Now able to set the localMatrix when creating a SkShader from a SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Corrects warnings in windows build Created 6 years, 5 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/image/SkImage_Base.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 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 "SkImagePriv.h" 10 #include "SkImagePriv.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // perhaps we could return true + empty-bitmap? 71 // perhaps we could return true + empty-bitmap?
72 return false; 72 return false;
73 } 73 }
74 return as_IB(this)->onReadPixels(bitmap, bounds); 74 return as_IB(this)->onReadPixels(bitmap, bounds);
75 } 75 }
76 76
77 GrTexture* SkImage::getTexture() { 77 GrTexture* SkImage::getTexture() {
78 return as_IB(this)->onGetTexture(); 78 return as_IB(this)->onGetTexture();
79 } 79 }
80 80
81 SkShader* SkImage::newShader(SkShader::TileMode tileX, SkShader::TileMode tileY) const { 81 SkShader* SkImage::newShader(SkShader::TileMode tileX,
82 return as_IB(this)->onNewShader(tileX, tileY); 82 SkShader::TileMode tileY,
83 const SkMatrix* localMatrix) const {
84 return as_IB(this)->onNewShader(tileX, tileY, localMatrix);
83 } 85 }
84 86
85 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { 87 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const {
86 SkBitmap bm; 88 SkBitmap bm;
87 if (as_IB(this)->getROPixels(&bm)) { 89 if (as_IB(this)->getROPixels(&bm)) {
88 return SkImageEncoder::EncodeData(bm, type, quality); 90 return SkImageEncoder::EncodeData(bm, type, quality);
89 } 91 }
90 return NULL; 92 return NULL;
91 } 93 }
92 94
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 133
132 SkCanvas canvas(*bitmap); 134 SkCanvas canvas(*bitmap);
133 135
134 SkPaint paint; 136 SkPaint paint;
135 paint.setXfermodeMode(SkXfermode::kClear_Mode); 137 paint.setXfermodeMode(SkXfermode::kClear_Mode);
136 canvas.drawRect(dstR, paint); 138 canvas.drawRect(dstR, paint);
137 139
138 const_cast<SkImage_Base*>(this)->onDrawRectToRect(&canvas, &srcR, dstR, NULL ); 140 const_cast<SkImage_Base*>(this)->onDrawRectToRect(&canvas, &srcR, dstR, NULL );
139 return true; 141 return true;
140 } 142 }
OLDNEW
« no previous file with comments | « include/core/SkImage.h ('k') | src/image/SkImage_Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698