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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 19729006: Hold on to image-filtered texture in SkGpuDevice (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 81b25b82b3b7a8f519a03f18ce6aeb617594099c..eaac5ab12c0a50264b65689c2f7d6701f1d5b662 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1388,12 +1388,14 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
SkImageFilter* filter = paint.getImageFilter();
SkIPoint offset = SkIPoint::Make(0, 0);
+ // This bitmap will own the filtered result as a texture.
+ SkBitmap filteredBitmap;
+
if (NULL != filter) {
- SkBitmap filterBitmap;
- if (filter_texture(this, fContext, texture, filter, w, h, &filterBitmap, &offset)) {
- texture = (GrTexture*) filterBitmap.getTexture();
- w = filterBitmap.width();
- h = filterBitmap.height();
+ if (filter_texture(this, fContext, texture, filter, w, h, &filteredBitmap, &offset)) {
+ texture = (GrTexture*) filteredBitmap.getTexture();
+ w = filteredBitmap.width();
+ h = filteredBitmap.height();
}
}
@@ -1468,14 +1470,15 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkDevice* device,
int h = bm.height();
SkImageFilter* filter = paint.getImageFilter();
+ // This bitmap will own the filtered result as a texture.
+ SkBitmap filteredBitmap;
if (NULL != filter) {
- SkBitmap filterBitmap;
SkIPoint offset = SkIPoint::Make(0, 0);
- if (filter_texture(this, fContext, devTex, filter, w, h, &filterBitmap, &offset)) {
- devTex = filterBitmap.getTexture();
- w = filterBitmap.width();
- h = filterBitmap.height();
+ if (filter_texture(this, fContext, devTex, filter, w, h, &filteredBitmap, &offset)) {
+ devTex = filteredBitmap.getTexture();
+ w = filteredBitmap.width();
+ h = filteredBitmap.height();
x += offset.fX;
y += offset.fY;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698