Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Side by Side Diff: tools/skiaserve/Request.h

Issue 1755563003: add /img/n/m endpoint to skiaserve (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: tweak Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/debugger/SkDebugCanvas.cpp ('k') | tools/skiaserve/Request.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 11 matching lines...) Expand all
22 22
23 struct UploadContext { 23 struct UploadContext {
24 SkDynamicMemoryWStream fStream; 24 SkDynamicMemoryWStream fStream;
25 MHD_PostProcessor* fPostProcessor; 25 MHD_PostProcessor* fPostProcessor;
26 MHD_Connection* connection; 26 MHD_Connection* connection;
27 }; 27 };
28 28
29 struct Request { 29 struct Request {
30 Request(SkString rootUrl); 30 Request(SkString rootUrl);
31 31
32 SkData* drawToPng(int n); 32 // draws to skia draw op N, highlighting the Mth batch(-1 means no highlight )
33 SkData* drawToPng(int n, int m = -1);
33 SkCanvas* getCanvas(); 34 SkCanvas* getCanvas();
34 SkBitmap* getBitmapFromCanvas(SkCanvas* canvas); 35 SkBitmap* getBitmapFromCanvas(SkCanvas* canvas);
35 bool enableGPU(bool enable); 36 bool enableGPU(bool enable);
36 bool hasPicture() const { return SkToBool(fPicture.get()); } 37 bool hasPicture() const { return SkToBool(fPicture.get()); }
37 int getLastOp() const { return fDebugCanvas->getSize() - 1; } 38 int getLastOp() const { return fDebugCanvas->getSize() - 1; }
38 39
39 bool initPictureFromStream(SkStream*); 40 bool initPictureFromStream(SkStream*);
40 41
41 // Returns the json list of ops as an SkData 42 // Returns the json list of ops as an SkData
42 SkData* getJsonOps(int n); 43 SkData* getJsonOps(int n);
43 44
44 // Returns a json list of batches as an SkData 45 // Returns a json list of batches as an SkData
45 SkData* getJsonBatchList(int n); 46 SkData* getJsonBatchList(int n);
46 47
47 // Returns json with the viewMatrix and clipRect 48 // Returns json with the viewMatrix and clipRect
48 SkData* getJsonInfo(int n); 49 SkData* getJsonInfo(int n);
49 50
50 // TODO probably want to make this configurable 51 // TODO probably want to make this configurable
51 static const int kImageWidth; 52 static const int kImageWidth;
52 static const int kImageHeight; 53 static const int kImageHeight;
53 54
54 UploadContext* fUploadContext; 55 UploadContext* fUploadContext;
55 SkAutoTUnref<SkDebugCanvas> fDebugCanvas; 56 SkAutoTUnref<SkDebugCanvas> fDebugCanvas;
56 UrlDataManager fUrlDataManager; 57 UrlDataManager fUrlDataManager;
57 58
58 private: 59 private:
59 SkData* writeCanvasToPng(SkCanvas* canvas); 60 SkData* writeCanvasToPng(SkCanvas* canvas);
60 void drawToCanvas(int n); 61 void drawToCanvas(int n, int m = -1);
61 SkSurface* createCPUSurface(); 62 SkSurface* createCPUSurface();
62 SkSurface* createGPUSurface(); 63 SkSurface* createGPUSurface();
63 GrAuditTrail* getAuditTrail(SkCanvas*); 64 GrAuditTrail* getAuditTrail(SkCanvas*);
64 void cleanupAuditTrail(SkCanvas*); 65 void cleanupAuditTrail(SkCanvas*);
65 66
66 SkAutoTUnref<SkPicture> fPicture; 67 SkAutoTUnref<SkPicture> fPicture;
67 SkAutoTDelete<GrContextFactory> fContextFactory; 68 SkAutoTDelete<GrContextFactory> fContextFactory;
68 SkAutoTUnref<SkSurface> fSurface; 69 SkAutoTUnref<SkSurface> fSurface;
69 bool fGPUEnabled; 70 bool fGPUEnabled;
70 }; 71 };
71 72
72 #endif 73 #endif
73 74
OLDNEW
« no previous file with comments | « tools/debugger/SkDebugCanvas.cpp ('k') | tools/skiaserve/Request.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698