Skip cross process pipe playback in gm/factory.cpp. Add a new flag to
gm.h to skip only this form of pipe playback.
In gmmain.cpp, use a bitmap encoder function for serialization that
stores the encoded data if present, and use a bitmap decoder on
deserialization. This allows gm/factory to work through serialization.
Also respect the new pipe skipping flag.
BUG=https://code.google.com/p/skia/issues/detail?id=1231
R=borenet@google.com
Author: scroggo@google.com
Review URL: https://chromiumcodereview.appspot.com/
23192004
git-svn-id: http://skia.googlecode.com/svn/trunk@10786
2bbb7eff-a529-9590-31e7-
b0007b416f81
canvas->drawBitmap(fBitmap, 0, 0);
}
+ // Skip cross process pipe due to https://code.google.com/p/skia/issues/detail?id=1520
+ virtual uint32_t onGetFlags() const {
+ return INHERITED::onGetFlags() | kSkipPipeCrossProcess_Flag;
+ }
+
private:
SkBitmap fBitmap;
virtual ~GM();
enum Flags {
- kSkipPDF_Flag = 1 << 0,
- kSkipPicture_Flag = 1 << 1,
- kSkipPipe_Flag = 1 << 2,
- kSkipTiled_Flag = 1 << 3,
- kSkip565_Flag = 1 << 4,
- kSkipScaledReplay_Flag = 1 << 5,
- kSkipGPU_Flag = 1 << 6,
+ kSkipPDF_Flag = 1 << 0,
+ kSkipPicture_Flag = 1 << 1,
+ kSkipPipe_Flag = 1 << 2,
+ kSkipPipeCrossProcess_Flag = 1 << 3,
+ kSkipTiled_Flag = 1 << 4,
+ kSkip565_Flag = 1 << 5,
+ kSkipScaledReplay_Flag = 1 << 6,
+ kSkipGPU_Flag = 1 << 7,
};
void draw(SkCanvas*);
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;
}
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);