Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
tools
skiaserve
Request.h
Go to the documentation of this file.
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 "
include/core/SkTypes.h
"
12
13
#include "
tools/gpu/GrContextFactory.h
"
14
15
#include "
include/core/SkPicture.h
"
16
#include "
include/core/SkStream.h
"
17
#include "
include/core/SkSurface.h
"
18
#include "
tools/debugger/DebugCanvas.h
"
19
20
#include "
tools/UrlDataManager.h
"
21
22
namespace
sk_gpu_test
{
23
class
GrContextFactory;
24
}
// namespace sk_gpu_test
25
struct
MHD_Connection;
26
struct
MHD_PostProcessor;
27
28
struct
UploadContext
{
29
SkDynamicMemoryWStream
fStream
;
30
MHD_PostProcessor*
fPostProcessor
;
31
MHD_Connection*
connection
;
32
};
33
34
struct
Request
{
35
Request
(
SkString
rootUrl);
36
~Request
();
37
38
// draws to canvas operation N, highlighting the Mth GrOp. m = -1 means no highlight.
39
sk_sp<SkData>
drawToPng
(
int
n,
int
m = -1);
40
sk_sp<SkData>
writeOutSkp
();
41
SkCanvas
*
getCanvas
();
42
bool
enableGPU
(
bool
enable);
43
bool
setOverdraw
(
bool
enable);
44
bool
setColorMode
(
int
mode);
45
bool
hasPicture
()
const
{
return
SkToBool
(fPicture.
get
()); }
46
int
getLastOp
()
const
{
return
fDebugCanvas
->getSize() - 1; }
47
48
bool
initPictureFromStream
(
SkStream
*);
49
50
// Returns the json list of ops as an SkData
51
sk_sp<SkData>
getJsonOps
();
52
53
// Returns a json list of ops as an SkData
54
sk_sp<SkData>
getJsonOpsTask
();
55
56
// Returns json with the viewMatrix and clipRect at the given command
57
sk_sp<SkData>
getJsonInfo
(
int
n);
58
59
// returns the color of the pixel at (x,y) in the canvas
60
SkColor
getPixel
(
int
x
,
int
y
);
61
62
UploadContext
*
fUploadContext
;
63
std::unique_ptr<DebugCanvas>
fDebugCanvas
;
64
UrlDataManager
fUrlDataManager
;
65
66
private
:
67
sk_sp<SkData>
writeCanvasToPng(
SkCanvas
* canvas);
68
SkSurface
* createCPUSurface();
69
SkSurface
* createGPUSurface();
70
SkIRect
getBounds();
71
GrDirectContext
* directContext();
72
73
sk_sp<SkPicture>
fPicture;
74
sk_gpu_test::GrContextFactory
* fContextFactory;
75
sk_sp<SkSurface>
fSurface;
76
bool
fGPUEnabled;
77
bool
fOverdraw;
78
int
fColorMode;
79
};
80
81
#endif
DebugCanvas.h
GrContextFactory.h
SkColor
uint32_t SkColor
Definition
SkColor.h:37
SkPicture.h
SkStream.h
SkSurface.h
SkToBool
static constexpr bool SkToBool(const T &x)
Definition
SkTo.h:35
SkTypes.h
UrlDataManager.h
GrDirectContext
Definition
GrDirectContext.h:60
SkCanvas
Definition
SkCanvas.h:106
SkDynamicMemoryWStream
Definition
SkStream.h:455
SkStream
Definition
SkStream.h:29
SkString
Definition
SkString.h:118
SkSurface
Definition
SkSurface.h:161
UrlDataManager
Definition
UrlDataManager.h:26
sk_gpu_test::GrContextFactory
Definition
GrContextFactory.h:34
sk_sp
Definition
SkRefCnt.h:220
sk_sp::get
T * get() const
Definition
SkRefCnt.h:303
y
double y
Definition
mouse-input-test.cc:83
x
double x
Definition
mouse-input-test.cc:82
sk_gpu_test
Definition
gm_bindings.cpp:339
Request
Definition
Request.h:34
Request::hasPicture
bool hasPicture() const
Definition
Request.h:45
Request::setOverdraw
bool setOverdraw(bool enable)
Definition
Request.cpp:171
Request::fUploadContext
UploadContext * fUploadContext
Definition
Request.h:62
Request::getPixel
SkColor getPixel(int x, int y)
Definition
Request.cpp:282
Request::getJsonInfo
sk_sp< SkData > getJsonInfo(int n)
Definition
Request.cpp:255
Request::drawToPng
sk_sp< SkData > drawToPng(int n, int m=-1)
Definition
Request.cpp:81
Request::getCanvas
SkCanvas * getCanvas()
Definition
Request.cpp:58
Request::enableGPU
bool enableGPU(bool enable)
Definition
Request.cpp:181
Request::~Request
~Request()
Definition
Request.cpp:40
Request::fDebugCanvas
std::unique_ptr< DebugCanvas > fDebugCanvas
Definition
Request.h:63
Request::writeOutSkp
sk_sp< SkData > writeOutSkp()
Definition
Request.cpp:90
Request::getJsonOpsTask
sk_sp< SkData > getJsonOpsTask()
Definition
Request.cpp:243
Request::initPictureFromStream
bool initPictureFromStream(SkStream *)
Definition
Request.cpp:205
Request::fUrlDataManager
UrlDataManager fUrlDataManager
Definition
Request.h:64
Request::getJsonOps
sk_sp< SkData > getJsonOps()
Definition
Request.cpp:227
Request::getLastOp
int getLastOp() const
Definition
Request.h:46
Request::setColorMode
bool setColorMode(int mode)
Definition
Request.cpp:176
SkIRect
Definition
SkRect.h:32
UploadContext
Definition
Request.h:28
UploadContext::fStream
SkDynamicMemoryWStream fStream
Definition
Request.h:29
UploadContext::connection
MHD_Connection * connection
Definition
Request.h:31
UploadContext::fPostProcessor
MHD_PostProcessor * fPostProcessor
Definition
Request.h:30
Generated on Fri Apr 26 2024 06:18:12 for Flutter Engine by
1.9.8