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

Unified Diff: gm/gmmain.cpp

Issue 14437012: Fixes for piping bitmaps with encoded data. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Do not use bitmap storage when adding bitmaps to SkGPipeState. Created 7 years, 8 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 | include/pipe/SkGPipe.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gmmain.cpp
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 4979d79a544ac381633c808389225bcab015dfb5..e21a714cf76b1b04c260d7edc37fabcc134d6b3c 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -951,7 +951,10 @@ public:
//@todo thudson 22 April 2011 when can we safely delete [] dst?
storage.copyTo(dst);
SkMemoryStream pictReadback(dst, streamSize);
- SkPicture* retval = new SkPicture (&pictReadback);
+ bool success;
+ // Pass a decoding bitmap function so that the factory GM (which has an SkBitmap with
+ // encoded data) does not fail.
+ SkPicture* retval = new SkPicture (&pictReadback, &success, &SkImageDecoder::DecodeMemory);
return retval;
}
@@ -1042,7 +1045,9 @@ public:
setup_bitmap(gRec, size, &bitmap);
SkCanvas canvas(bitmap);
installFilter(&canvas);
- PipeController pipeController(&canvas);
+ // Pass a decoding function so the factory GM (which has an SkBitmap
+ // with encoded data) will not fail playback.
+ PipeController pipeController(&canvas, &SkImageDecoder::DecodeMemory);
SkGPipeWriter writer;
SkCanvas* pipeCanvas = writer.startRecording(&pipeController,
gPipeWritingFlagCombos[i].flags,
@@ -1081,7 +1086,7 @@ public:
setup_bitmap(gRec, size, &bitmap);
SkCanvas canvas(bitmap);
installFilter(&canvas);
- TiledPipeController pipeController(bitmap);
+ TiledPipeController pipeController(bitmap, &SkImageDecoder::DecodeMemory);
SkGPipeWriter writer;
SkCanvas* pipeCanvas = writer.startRecording(&pipeController,
gPipeWritingFlagCombos[i].flags,
« no previous file with comments | « no previous file | include/pipe/SkGPipe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698