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

Unified Diff: gm/gmmain.cpp

Issue 23192004: Fixes for factory GM. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Be more specific about what to skip. Created 7 years, 4 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 | « gm/gm.h ('k') | no next file » | 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 a4ddbcee4789dffc5cc3834899d2e3679d6b372d..773e1e769c72811cf458aac59278b3cd1a3d2c04 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -1014,11 +1014,24 @@ public:
return pict;
}
+ static SkData* bitmap_encoder(size_t* pixelRefOffset, const SkBitmap& bm) {
+ SkPixelRef* pr = bm.pixelRef();
+ if (pr != NULL) {
+ SkData* data = pr->refEncodedData();
+ if (data != NULL) {
+ *pixelRefOffset = bm.pixelRefOffset();
+ return data;
+ }
+ }
+ return NULL;
+ }
+
static SkPicture* stream_to_new_picture(const SkPicture& src) {
SkDynamicMemoryWStream storage;
- src.serialize(&storage);
+ src.serialize(&storage, &bitmap_encoder);
SkAutoTUnref<SkStreamAsset> pictReadback(storage.detachAsStream());
- SkPicture* retval = SkPicture::CreateFromStream(pictReadback);
+ SkPicture* retval = SkPicture::CreateFromStream(pictReadback,
+ &SkImageDecoder::DecodeMemory);
return retval;
}
@@ -1108,7 +1121,9 @@ public:
SkString renderModeDescriptor("-pipe");
renderModeDescriptor.append(gPipeWritingFlagCombos[i].name);
- if (gm->getFlags() & GM::kSkipPipe_Flag) {
+ if (gm->getFlags() & GM::kSkipPipe_Flag
+ || (gPipeWritingFlagCombos[i].flags == SkGPipeWriter::kCrossProcess_Flag
+ && gm->getFlags() & GM::kSkipPipeCrossProcess_Flag)) {
RecordTestResults(kIntentionallySkipped_ErrorType, shortNamePlusConfig,
renderModeDescriptor.c_str());
errors.add(kIntentionallySkipped_ErrorType);
« no previous file with comments | « gm/gm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698