skia2/dm/DMPDFRasterizeTask.h
mtklein e4d3e605f7 DM: SKP source / PDF backend
Removed expectations code for PDF backend for now, given that we don't have any, and refactored a little to make that cleaner.

We can now test .skp -> .pdf -> .png in DM.  Neat eh?

BUG=skia:2598
R=halcanary@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/316643003
2014-06-06 09:28:43 -07:00

41 lines
942 B
C++

/*
* Copyright 2014 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef DMPDFRasterizeTask_DEFINED
#define DMPDFRasterizeTask_DEFINED
#include "DMTask.h"
#include "SkBitmap.h"
#include "SkData.h"
#include "SkStream.h"
#include "SkString.h"
#include "SkTemplates.h"
namespace DM {
typedef bool (*RasterizePdfProc)(SkStream* pdf, SkBitmap* output);
class PDFRasterizeTask : public CpuTask {
public:
PDFRasterizeTask(const Task& parent,
SkData* pdf,
RasterizePdfProc);
virtual void draw() SK_OVERRIDE;
virtual bool shouldSkip() const SK_OVERRIDE { return NULL == fRasterize; }
virtual SkString name() const SK_OVERRIDE { return fName; }
private:
const SkString fName;
SkAutoTUnref<SkData> fPdf;
RasterizePdfProc fRasterize;
};
} // namespace DM
#endif // DMPDFRasterizeTask_DEFINED