joshualitt | 24dd687 | 2016-02-25 08:37:54 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2016 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 Request_DEFINED |
| 9 | #define Request_DEFINED |
| 10 | |
| 11 | #include "GrContextFactory.h" |
| 12 | |
| 13 | #include "SkDebugCanvas.h" |
| 14 | #include "SkPicture.h" |
| 15 | #include "SkStream.h" |
| 16 | #include "SkSurface.h" |
| 17 | |
| 18 | #include "UrlDataManager.h" |
| 19 | |
| 20 | struct MHD_Connection; |
| 21 | struct MHD_PostProcessor; |
| 22 | |
| 23 | struct UploadContext { |
| 24 | SkDynamicMemoryWStream fStream; |
| 25 | MHD_PostProcessor* fPostProcessor; |
| 26 | MHD_Connection* connection; |
| 27 | }; |
| 28 | |
| 29 | struct Request { |
| 30 | Request(SkString rootUrl) |
| 31 | : fUploadContext(nullptr) |
| 32 | , fUrlDataManager(rootUrl) |
| 33 | , fGPUEnabled(false) {} |
| 34 | |
| 35 | UploadContext* fUploadContext; |
| 36 | SkAutoTUnref<SkPicture> fPicture; |
| 37 | SkAutoTUnref<SkDebugCanvas> fDebugCanvas; |
| 38 | SkAutoTDelete<GrContextFactory> fContextFactory; |
| 39 | SkAutoTUnref<SkSurface> fSurface; |
| 40 | UrlDataManager fUrlDataManager; |
| 41 | bool fGPUEnabled; |
| 42 | }; |
| 43 | |
| 44 | #endif |
| 45 | |