OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef Request_DEFINED | 8 #ifndef Request_DEFINED |
9 #define Request_DEFINED | 9 #define Request_DEFINED |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 , fUrlDataManager(rootUrl) | 32 , fUrlDataManager(rootUrl) |
33 , fGPUEnabled(false) {} | 33 , fGPUEnabled(false) {} |
34 | 34 |
35 SkSurface* createCPUSurface(); | 35 SkSurface* createCPUSurface(); |
36 SkSurface* createGPUSurface(); | 36 SkSurface* createGPUSurface(); |
37 SkData* drawToPng(int n); | 37 SkData* drawToPng(int n); |
38 void drawToCanvas(int n); | 38 void drawToCanvas(int n); |
39 SkCanvas* getCanvas(); | 39 SkCanvas* getCanvas(); |
40 SkData* writeCanvasToPng(SkCanvas* canvas); | 40 SkData* writeCanvasToPng(SkCanvas* canvas); |
41 SkBitmap* getBitmapFromCanvas(SkCanvas* canvas); | 41 SkBitmap* getBitmapFromCanvas(SkCanvas* canvas); |
| 42 bool hasPicture() const { return SkToBool(fPicture.get()); } |
| 43 int getLastOp() const { return fDebugCanvas->getSize() - 1; } |
| 44 |
| 45 // Returns the json list of ops as an SkData |
| 46 SkData* getJsonOps(int n); |
| 47 |
| 48 // Returns a json list of batches as an SkData |
| 49 SkData* getJsonBatchList(int n); |
42 | 50 |
43 // TODO probably want to make this configurable | 51 // TODO probably want to make this configurable |
44 static const int kImageWidth; | 52 static const int kImageWidth; |
45 static const int kImageHeight; | 53 static const int kImageHeight; |
46 | 54 |
47 UploadContext* fUploadContext; | 55 UploadContext* fUploadContext; |
48 SkAutoTUnref<SkPicture> fPicture; | 56 SkAutoTUnref<SkPicture> fPicture; |
49 SkAutoTUnref<SkDebugCanvas> fDebugCanvas; | 57 SkAutoTUnref<SkDebugCanvas> fDebugCanvas; |
50 SkAutoTDelete<GrContextFactory> fContextFactory; | 58 SkAutoTDelete<GrContextFactory> fContextFactory; |
51 SkAutoTUnref<SkSurface> fSurface; | 59 SkAutoTUnref<SkSurface> fSurface; |
52 UrlDataManager fUrlDataManager; | 60 UrlDataManager fUrlDataManager; |
53 bool fGPUEnabled; | 61 bool fGPUEnabled; |
54 }; | 62 }; |
55 | 63 |
56 #endif | 64 #endif |
57 | 65 |
OLD | NEW |