// For a high-level overview, please see dm/README.
#include "CrashHandler.h"
+#include "LazyDecodeBitmap.h"
#include "SkCommonFlags.h"
#include "SkForceLinking.h"
#include "SkGraphics.h"
SkDebugf("Could not read %s.\n", skps[i].c_str());
exit(1);
}
- SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(stream.get()));
+ SkAutoTUnref<SkPicture> pic(
+ SkPicture::CreateFromStream(stream.get(), &sk_tools::LazyDecodeBitmap));
if (pic.get() == NULL) {
SkDebugf("Could not read %s as an SkPicture.\n", skps[i].c_str());
exit(1);
#include "SkPictureRecorder.h"
DEFINE_bool(skr, true, "Test that SKPs draw the same when re-recorded with SkRecord backend.");
+DEFINE_int32(skpMaxWidth, 1000, "Max SKPTask viewport width.");
+DEFINE_int32(skpMaxHeight, 1000, "Max SKPTask viewport height.");
namespace DM {
SkAutoTDelete<const SkPicture> skrPicture(recorder.endRecording());
SkBitmap bitmap;
- AllocatePixels(kN32_SkColorType, fPicture->width(), fPicture->height(), &bitmap);
+ AllocatePixels(kN32_SkColorType, fReference.width(), fReference.height(), &bitmap);
DrawPicture(*skrPicture, &bitmap);
if (!BitmapsEqual(fReference, bitmap)) {
: CpuTask(r, tr), fPicture(SkRef(pic)), fName(FileToTaskName(filename)) {}
void SKPTask::draw() {
+ const int width = SkTMin(fPicture->width(), FLAGS_skpMaxWidth),
+ height = SkTMin(fPicture->height(), FLAGS_skpMaxHeight);
SkBitmap bitmap;
- AllocatePixels(kN32_SkColorType, fPicture->width(), fPicture->height(), &bitmap);
+ AllocatePixels(kN32_SkColorType, width, height, &bitmap);
DrawPicture(*fPicture, &bitmap);
this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap)));
'../src/utils/debugger/SkDebugCanvas.cpp',
'../src/utils/debugger/SkDrawCommand.cpp',
'../src/utils/debugger/SkObjectParser.cpp',
+ '../tools/LazyDecodeBitmap.cpp',
],
'conditions': [
[ 'skia_gpu == 1', {