OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2014 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef DMPDFRasterizeTask_DEFINED |
| 9 #define DMPDFRasterizeTask_DEFINED |
| 10 |
| 11 #include "DMExpectations.h" |
| 12 #include "DMTask.h" |
| 13 #include "SkBitmap.h" |
| 14 #include "SkData.h" |
| 15 #include "SkStream.h" |
| 16 #include "SkString.h" |
| 17 #include "SkTemplates.h" |
| 18 |
| 19 namespace DM { |
| 20 |
| 21 typedef bool (*RasterizePdfProc)(SkStream* pdf, SkBitmap* output); |
| 22 |
| 23 class PDFRasterizeTask : public CpuTask { |
| 24 public: |
| 25 PDFRasterizeTask(const Task& parent, |
| 26 SkData* pdf, |
| 27 const Expectations&, |
| 28 RasterizePdfProc); |
| 29 |
| 30 virtual void draw() SK_OVERRIDE; |
| 31 virtual bool shouldSkip() const SK_OVERRIDE { return NULL == fRasterize; } |
| 32 virtual SkString name() const SK_OVERRIDE { return fName; } |
| 33 |
| 34 private: |
| 35 const SkString fName; |
| 36 SkAutoTUnref<SkData> fPdf; |
| 37 const Expectations& fExpectations; |
| 38 RasterizePdfProc fRasterize; |
| 39 }; |
| 40 |
| 41 } // namespace DM |
| 42 |
| 43 #endif // DMPDFRasterizeTask_DEFINED |
OLD | NEW |