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

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

Issue 2206633004: Move off SK_SUPPORT_LEGACY_DATA_FACTORIES. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Gotta catch 'em all. Created 4 years, 4 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
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 18 matching lines...) Expand all
29 SkDynamicMemoryWStream fStream; 29 SkDynamicMemoryWStream fStream;
30 MHD_PostProcessor* fPostProcessor; 30 MHD_PostProcessor* fPostProcessor;
31 MHD_Connection* connection; 31 MHD_Connection* connection;
32 }; 32 };
33 33
34 struct Request { 34 struct Request {
35 Request(SkString rootUrl); 35 Request(SkString rootUrl);
36 ~Request(); 36 ~Request();
37 37
38 // draws to skia draw op N, highlighting the Mth batch(-1 means no highlight ) 38 // draws to skia draw op N, highlighting the Mth batch(-1 means no highlight )
39 SkData* drawToPng(int n, int m = -1); 39 sk_sp<SkData> drawToPng(int n, int m = -1);
40 SkData* writeOutSkp(); 40 sk_sp<SkData> writeOutSkp();
41 SkCanvas* getCanvas(); 41 SkCanvas* getCanvas();
42 SkBitmap* getBitmapFromCanvas(SkCanvas* canvas); 42 SkBitmap* getBitmapFromCanvas(SkCanvas* canvas);
43 bool enableGPU(bool enable); 43 bool enableGPU(bool enable);
44 bool setColorMode(int mode); 44 bool setColorMode(int mode);
45 bool hasPicture() const { return SkToBool(fPicture.get()); } 45 bool hasPicture() const { return SkToBool(fPicture.get()); }
46 int getLastOp() const { return fDebugCanvas->getSize() - 1; } 46 int getLastOp() const { return fDebugCanvas->getSize() - 1; }
47 47
48 bool initPictureFromStream(SkStream*); 48 bool initPictureFromStream(SkStream*);
49 49
50 // Returns the json list of ops as an SkData 50 // Returns the json list of ops as an SkData
51 SkData* getJsonOps(int n); 51 sk_sp<SkData> getJsonOps(int n);
52 52
53 // Returns a json list of batches as an SkData 53 // Returns a json list of batches as an SkData
54 SkData* getJsonBatchList(int n); 54 sk_sp<SkData> getJsonBatchList(int n);
55 55
56 // Returns json with the viewMatrix and clipRect 56 // Returns json with the viewMatrix and clipRect
57 SkData* getJsonInfo(int n); 57 sk_sp<SkData> getJsonInfo(int n);
58 58
59 // returns the color of the pixel at (x,y) in the canvas 59 // returns the color of the pixel at (x,y) in the canvas
60 SkColor getPixel(int x, int y); 60 SkColor getPixel(int x, int y);
61 61
62 UploadContext* fUploadContext; 62 UploadContext* fUploadContext;
63 SkAutoTUnref<SkDebugCanvas> fDebugCanvas; 63 SkAutoTUnref<SkDebugCanvas> fDebugCanvas;
64 UrlDataManager fUrlDataManager; 64 UrlDataManager fUrlDataManager;
65 65
66 private: 66 private:
67 SkData* writeCanvasToPng(SkCanvas* canvas); 67 sk_sp<SkData> writeCanvasToPng(SkCanvas* canvas);
68 void drawToCanvas(int n, int m = -1); 68 void drawToCanvas(int n, int m = -1);
69 SkSurface* createCPUSurface(); 69 SkSurface* createCPUSurface();
70 SkSurface* createGPUSurface(); 70 SkSurface* createGPUSurface();
71 SkIRect getBounds(); 71 SkIRect getBounds();
72 GrContext* getContext(); 72 GrContext* getContext();
73 73
74 sk_sp<SkPicture> fPicture; 74 sk_sp<SkPicture> fPicture;
75 sk_gpu_test::GrContextFactory* fContextFactory; 75 sk_gpu_test::GrContextFactory* fContextFactory;
76 SkAutoTUnref<SkSurface> fSurface; 76 SkAutoTUnref<SkSurface> fSurface;
77 bool fGPUEnabled; 77 bool fGPUEnabled;
78 int fColorMode; 78 int fColorMode;
79 }; 79 };
80 80
81 #endif 81 #endif
OLDNEW
« include/core/SkData.h ('K') | « tools/skhello.cpp ('k') | tools/skiaserve/Request.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698