Definition at line 84 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 220 of file debugger_bindings.cpp.
220 {
222 }
void deleteDrawCommandAt(int index)
DebugCanvas * visibleCanvas()
◆ draw()
void SkpDebugPlayer::draw |
( |
SkSurface * |
surface | ) |
|
|
inline |
Definition at line 151 of file debugger_bindings.cpp.
151 {
152 auto* canvas =
surface->getCanvas();
154 frames[fp]->draw(
surface->getCanvas());
155#ifdef CK_ENABLE_WEBGL
157#endif
158 }
constexpr SkColor SK_ColorTRANSPARENT
SK_API GrSemaphoresSubmitted Flush(sk_sp< SkSurface >)
◆ drawTo()
void SkpDebugPlayer::drawTo |
( |
SkSurface * |
surface, |
|
|
int32_t |
index |
|
) |
| |
|
inline |
Definition at line 128 of file debugger_bindings.cpp.
128 {
129
130 if (fInspectedLayer >= 0) {
131 fLayerManager->setCommand(fInspectedLayer, fp, index);
132 } else {
133 index = constrainFrameCommand(index);
134 }
135
136 auto* canvas =
surface->getCanvas();
138 if (fInspectedLayer >= 0) {
139
140 fLayerManager->drawLayerEventTo(
surface, fInspectedLayer, fp);
141 } else {
142
143 frames[fp]->drawTo(
surface->getCanvas(), index);
144 }
145#ifdef CK_ENABLE_WEBGL
147#endif
148 }
◆ findCommandByPixel()
Definition at line 356 of file debugger_bindings.cpp.
356 {
357
359
360 int lowerBound = 0;
361 int upperBound = commandIndex;
362
363 while (upperBound - lowerBound > 1) {
364 int command = (upperBound - lowerBound) / 2 + lowerBound;
366 if (c == finalColor) {
368 } else {
370 }
371 }
372
374 return upperBound;
375 }
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 162 of file debugger_bindings.cpp.
162 {
163 if (fInspectedLayer < 0) {
164 return fBoundsArray[
frame];
165 }
166 auto summary = fLayerManager->event(fInspectedLayer, fp);
168 }
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 298 of file debugger_bindings.cpp.
298 {
300 }
ImageInfoNoColorspace toImageInfoNoColorspace(const SkImageInfo &ii)
◆ getImageResource()
std::string SkpDebugPlayer::getImageResource |
( |
int |
index | ) |
|
|
inline |
Definition at line 283 of file debugger_bindings.cpp.
283 {
289 dst.prepend(
"data:image/png;base64,");
290 return std::string(
dst.c_str());
291 }
const void * data() const
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 333 of file debugger_bindings.cpp.
333 {
335 for (
auto key : fLayerManager->getKeys()) {
336 JSObject item = emscripten::val::object();
337 item.set(
"frame",
key.frame);
338 item.set(
"nodeId",
key.nodeId);
339 result.call<
void>(
"push", item);
340 }
342 }
◆ getLayerSummariesJs()
JSArray SkpDebugPlayer::getLayerSummariesJs |
( |
| ) |
|
|
inline |
Definition at line 325 of file debugger_bindings.cpp.
325 {
327 for (auto summary : fLayerManager->summarizeLayers(fp)) {
328 result.call<
void>(
"push", summary);
329 }
331 }
◆ getSize()
int SkpDebugPlayer::getSize |
( |
| ) |
const |
|
inline |
Definition at line 226 of file debugger_bindings.cpp.
226 {
227 if (fInspectedLayer >=0) {
228 return fLayerManager->event(fInspectedLayer, fp).commandCount;
229 } else {
230 return frames[fp]->getSize();
231 }
232 }
◆ imageUseInfo()
Definition at line 306 of file debugger_bindings.cpp.
306 {
308 DebugCanvas* debugCanvas = frames[framenumber].get();
309 if (nodeid >= 0) {
310 debugCanvas = fLayerManager->getEventDebugCanvas(nodeid, framenumber);
311 }
313 for (
auto it =
map.begin(); it !=
map.end(); ++it) {
314 JSArray list = emscripten::val::array();
315 for (const int commandId : it->second) {
316 list.call<void>("push", commandId);
317 }
319 }
321 }
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]...))>
static SkString to_string(int n)
◆ jsonCommandList()
std::string SkpDebugPlayer::jsonCommandList |
( |
sk_sp< SkSurface > |
surface | ) |
|
|
inline |
Definition at line 238 of file debugger_bindings.cpp.
238 {
241 writer.beginObject();
243 writer.endObject();
244 writer.flush();
245 auto skdata =
stream.detachAsData();
246
247 std::string_view data_view(reinterpret_cast<const char*>(skdata->data()), skdata->size());
248
249 return std::string(data_view);
250 }
void toJSON(SkJSONWriter &writer, UrlDataManager &urlDataManager, SkCanvas *)
◆ lastCommandInfo()
std::string SkpDebugPlayer::lastCommandInfo |
( |
| ) |
|
|
inline |
Definition at line 253 of file debugger_bindings.cpp.
253 {
256
259 writer.beginObject();
260
261 writer.appendName("ViewMatrix");
263 writer.appendName("ClipRect");
265
266 writer.endObject();
267 writer.flush();
268 auto skdata =
stream.detachAsData();
269
270 std::string_view data_view(reinterpret_cast<const char*>(skdata->data()), skdata->size());
271
272 return std::string(data_view);
273 }
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 101 of file debugger_bindings.cpp.
101 {
102 const uint8_t*
data =
reinterpret_cast<const uint8_t*
>(cptr);
103
107
108
109 if (isMulti) {
110 SkDebugf(
"Try reading as a multi-frame skp\n");
113 } else {
114 SkDebugf(
"Try reading as single-frame skp\n");
115
116 std::unique_ptr<DebugCanvas> canvas = loadSingleFrame(&
stream);
117 if (!canvas) {
118 return "Error loading single frame";
119 }
120 frames.push_back(std::move(canvas));
121 }
122 return "";
123 }
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static constexpr char kMultiMagic[]
const uint8_t uint32_t uint32_t GError ** error
std::shared_ptr< const fml::Mapping > data
◆ setAndroidClipViz()
void SkpDebugPlayer::setAndroidClipViz |
( |
bool |
on | ) |
|
|
inline |
Definition at line 207 of file debugger_bindings.cpp.
207 {
208 for (
size_t i=0;
i < frames.size();
i++) {
209 frames[
i]->setAndroidClipViz(on);
210 }
211
212 }
◆ 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 195 of file debugger_bindings.cpp.
195 {
196 for (
size_t i=0;
i < frames.size();
i++) {
197 frames[
i]->setDrawGpuOpBounds(on);
198 }
199 fLayerManager->setDrawGpuOpBounds(on);
200 }
◆ setInspectedLayer()
void SkpDebugPlayer::setInspectedLayer |
( |
int |
nodeId | ) |
|
|
inline |
◆ setOriginVisible()
void SkpDebugPlayer::setOriginVisible |
( |
bool |
on | ) |
|
|
inline |
Definition at line 213 of file debugger_bindings.cpp.
213 {
214 for (
size_t i=0;
i < frames.size();
i++) {
215 frames[
i]->setOriginVisible(on);
216 }
217 }
◆ setOverdrawVis()
void SkpDebugPlayer::setOverdrawVis |
( |
bool |
on | ) |
|
|
inline |
Definition at line 189 of file debugger_bindings.cpp.
189 {
190 for (
size_t i=0;
i < frames.size();
i++) {
191 frames[
i]->setOverdrawViz(on);
192 }
193 fLayerManager->setOverdrawViz(on);
194 }
◆ visibleCanvas()
Definition at line 177 of file debugger_bindings.cpp.
177 {
178 if (fInspectedLayer >=0) {
179 return fLayerManager->getEventDebugCanvas(fInspectedLayer, fp);
180 } else {
181 return frames[fp].get();
182 }
183 }
The documentation for this class was generated from the following file: