Definition at line 68 of file debugger_bindings.cpp.
◆ SkpDebugPlayer()
SkpDebugPlayer::SkpDebugPlayer |
( |
| ) |
|
|
inline |
◆ changeFrame()
void SkpDebugPlayer::changeFrame |
( |
int |
index | ) |
|
|
inline |
◆ deleteCommand()
void SkpDebugPlayer::deleteCommand |
( |
int |
index | ) |
|
|
inline |
Definition at line 204 of file debugger_bindings.cpp.
204 {
206 }
void deleteDrawCommandAt(int index)
DebugCanvas * visibleCanvas()
◆ draw()
void SkpDebugPlayer::draw |
( |
SkSurface * |
surface | ) |
|
|
inline |
Definition at line 135 of file debugger_bindings.cpp.
135 {
136 auto* canvas =
surface->getCanvas();
138 frames[fp]->draw(
surface->getCanvas());
139#ifdef CK_ENABLE_WEBGL
141#endif
142 }
constexpr SkColor SK_ColorTRANSPARENT
SK_API GrSemaphoresSubmitted Flush(sk_sp< SkSurface >)
◆ drawTo()
void SkpDebugPlayer::drawTo |
( |
SkSurface * |
surface, |
|
|
int32_t |
index |
|
) |
| |
|
inline |
Definition at line 112 of file debugger_bindings.cpp.
112 {
113
114 if (fInspectedLayer >= 0) {
115 fLayerManager->setCommand(fInspectedLayer, fp, index);
116 } else {
117 index = constrainFrameCommand(index);
118 }
119
120 auto* canvas =
surface->getCanvas();
122 if (fInspectedLayer >= 0) {
123
124 fLayerManager->drawLayerEventTo(
surface, fInspectedLayer, fp);
125 } else {
126
127 frames[fp]->drawTo(
surface->getCanvas(), index);
128 }
129#ifdef CK_ENABLE_WEBGL
131#endif
132 }
◆ findCommandByPixel()
Definition at line 340 of file debugger_bindings.cpp.
340 {
341
343
344 int lowerBound = 0;
345 int upperBound = commandIndex;
346
347 while (upperBound - lowerBound > 1) {
348 int command = (upperBound - lowerBound) / 2 + lowerBound;
349 auto c = evaluateCommandColor(
surface, command,
x,
y);
350 if (c == finalColor) {
352 } else {
354 }
355 }
356
358 return upperBound;
359 }
void drawTo(SkSurface *surface, int32_t index)
◆ getBounds()
const SkIRect SkpDebugPlayer::getBounds |
( |
| ) |
|
|
inline |
◆ getBoundsForFrame()
const SkIRect SkpDebugPlayer::getBoundsForFrame |
( |
int32_t |
frame | ) |
|
|
inline |
Definition at line 146 of file debugger_bindings.cpp.
146 {
147 if (fInspectedLayer < 0) {
148 return fBoundsArray[
frame];
149 }
150 auto summary = fLayerManager->event(fInspectedLayer, fp);
152 }
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
◆ getFrameCount()
int SkpDebugPlayer::getFrameCount |
( |
| ) |
const |
|
inline |
◆ getImageCount()
int SkpDebugPlayer::getImageCount |
( |
| ) |
|
|
inline |
◆ getImageInfo()
Definition at line 282 of file debugger_bindings.cpp.
282 {
284 }
ImageInfoNoColorspace toImageInfoNoColorspace(const SkImageInfo &ii)
◆ getImageResource()
std::string SkpDebugPlayer::getImageResource |
( |
int |
index | ) |
|
|
inline |
Definition at line 267 of file debugger_bindings.cpp.
267 {
273 dst.prepend(
"data:image/png;base64,");
274 return std::string(
dst.c_str());
275 }
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
const myers::Point & get(const myers::Segment &)
static size_t EncodedSize(size_t srcDataLength)
static size_t Encode(const void *src, size_t length, void *dst, const char *encode=nullptr)
◆ getLayerKeys()
JSArray SkpDebugPlayer::getLayerKeys |
( |
| ) |
|
|
inline |
Definition at line 317 of file debugger_bindings.cpp.
317 {
319 for (
auto key : fLayerManager->getKeys()) {
320 JSObject item = emscripten::val::object();
321 item.set(
"frame",
key.frame);
322 item.set(
"nodeId",
key.nodeId);
323 result.call<
void>(
"push", item);
324 }
326 }
◆ getLayerSummariesJs()
JSArray SkpDebugPlayer::getLayerSummariesJs |
( |
| ) |
|
|
inline |
Definition at line 309 of file debugger_bindings.cpp.
309 {
311 for (auto summary : fLayerManager->summarizeLayers(fp)) {
312 result.call<
void>(
"push", summary);
313 }
315 }
◆ getSize()
int SkpDebugPlayer::getSize |
( |
| ) |
const |
|
inline |
Definition at line 210 of file debugger_bindings.cpp.
210 {
211 if (fInspectedLayer >=0) {
212 return fLayerManager->event(fInspectedLayer, fp).commandCount;
213 } else {
214 return frames[fp]->getSize();
215 }
216 }
◆ imageUseInfo()
Definition at line 290 of file debugger_bindings.cpp.
290 {
292 DebugCanvas* debugCanvas = frames[framenumber].get();
293 if (nodeid >= 0) {
294 debugCanvas = fLayerManager->getEventDebugCanvas(nodeid, framenumber);
295 }
297 for (
auto it =
map.begin(); it !=
map.end(); ++it) {
298 JSArray list = emscripten::val::array();
299 for (const int commandId : it->second) {
300 list.call<void>("push", commandId);
301 }
302 result.set(std::to_string(it->first), list);
303 }
305 }
std::map< int, std::vector< int > > getImageIdToCommandMap(UrlDataManager &udm) const
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
◆ jsonCommandList()
std::string SkpDebugPlayer::jsonCommandList |
( |
sk_sp< SkSurface > |
surface | ) |
|
|
inline |
Definition at line 222 of file debugger_bindings.cpp.
222 {
225 writer.beginObject();
227 writer.endObject();
228 writer.flush();
229 auto skdata =
stream.detachAsData();
230
231 std::string_view data_view(reinterpret_cast<const char*>(skdata->data()), skdata->size());
232
233 return std::string(data_view);
234 }
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager, SkCanvas *)
◆ lastCommandInfo()
std::string SkpDebugPlayer::lastCommandInfo |
( |
| ) |
|
|
inline |
Definition at line 237 of file debugger_bindings.cpp.
237 {
240
243 writer.beginObject();
244
245 writer.appendName("ViewMatrix");
247 writer.appendName("ClipRect");
249
250 writer.endObject();
251 writer.flush();
252 auto skdata =
stream.detachAsData();
253
254 std::string_view data_view(reinterpret_cast<const char*>(skdata->data()), skdata->size());
255
256 return std::string(data_view);
257 }
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
const SkIRect & getCurrentClip()
const SkM44 & getCurrentMatrix()
static void MakeJsonMatrix44(SkJSONWriter &, const SkM44 &)
static void MakeJsonIRect(SkJSONWriter &, const SkIRect &)
◆ loadSkp()
std::string SkpDebugPlayer::loadSkp |
( |
uintptr_t |
cptr, |
|
|
int |
length |
|
) |
| |
|
inline |
Definition at line 85 of file debugger_bindings.cpp.
85 {
86 const uint8_t*
data =
reinterpret_cast<const uint8_t*
>(cptr);
87
91
92
93 if (isMulti) {
94 SkDebugf(
"Try reading as a multi-frame skp\n");
95 const auto&
error = loadMultiFrame(&stream);
97 } else {
98 SkDebugf(
"Try reading as single-frame skp\n");
99
100 std::unique_ptr<DebugCanvas> canvas = loadSingleFrame(&stream);
101 if (!canvas) {
102 return "Error loading single frame";
103 }
104 frames.push_back(std::move(canvas));
105 }
106 return "";
107 }
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static constexpr char kMultiMagic[]
const uint8_t uint32_t uint32_t GError ** error
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
◆ setAndroidClipViz()
void SkpDebugPlayer::setAndroidClipViz |
( |
bool |
on | ) |
|
|
inline |
Definition at line 191 of file debugger_bindings.cpp.
191 {
192 for (size_t i=0; i < frames.size(); i++) {
193 frames[i]->setAndroidClipViz(on);
194 }
195
196 }
◆ setClipVizColor()
void SkpDebugPlayer::setClipVizColor |
( |
JSColor |
color | ) |
|
|
inline |
◆ setCommandVisibility()
void SkpDebugPlayer::setCommandVisibility |
( |
int |
index, |
|
|
bool |
visible |
|
) |
| |
|
inline |
◆ setGpuOpBounds()
void SkpDebugPlayer::setGpuOpBounds |
( |
bool |
on | ) |
|
|
inline |
Definition at line 179 of file debugger_bindings.cpp.
179 {
180 for (size_t i=0; i < frames.size(); i++) {
181 frames[i]->setDrawGpuOpBounds(on);
182 }
183 fLayerManager->setDrawGpuOpBounds(on);
184 }
◆ setInspectedLayer()
void SkpDebugPlayer::setInspectedLayer |
( |
int |
nodeId | ) |
|
|
inline |
◆ setOriginVisible()
void SkpDebugPlayer::setOriginVisible |
( |
bool |
on | ) |
|
|
inline |
Definition at line 197 of file debugger_bindings.cpp.
197 {
198 for (size_t i=0; i < frames.size(); i++) {
199 frames[i]->setOriginVisible(on);
200 }
201 }
◆ setOverdrawVis()
void SkpDebugPlayer::setOverdrawVis |
( |
bool |
on | ) |
|
|
inline |
Definition at line 173 of file debugger_bindings.cpp.
173 {
174 for (size_t i=0; i < frames.size(); i++) {
175 frames[i]->setOverdrawViz(on);
176 }
177 fLayerManager->setOverdrawViz(on);
178 }
◆ visibleCanvas()
Definition at line 161 of file debugger_bindings.cpp.
161 {
162 if (fInspectedLayer >=0) {
163 return fLayerManager->getEventDebugCanvas(fInspectedLayer, fp);
164 } else {
165 return frames[fp].get();
166 }
167 }
The documentation for this class was generated from the following file: