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

Side by Side Diff: tools/debugger/SkDebugCanvas.cpp

Issue 1755563003: add /img/n/m endpoint to skiaserve (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: tweak Created 4 years, 9 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
« no previous file with comments | « tools/debugger/SkDebugCanvas.h ('k') | tools/skiaserve/Request.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 #include "SkCanvasPriv.h" 8 #include "SkCanvasPriv.h"
9 #include "SkClipStack.h" 9 #include "SkClipStack.h"
10 #include "SkDebugCanvas.h" 10 #include "SkDebugCanvas.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 fActiveLayers.pop(); 189 fActiveLayers.pop();
190 } 190 }
191 } 191 }
192 192
193 for (int i = 0; i < fActiveLayers.count(); ++i) { 193 for (int i = 0; i < fActiveLayers.count(); ++i) {
194 fActiveLayers[i]->setActive(true); 194 fActiveLayers[i]->setActive(true);
195 } 195 }
196 196
197 } 197 }
198 198
199 void SkDebugCanvas::drawTo(SkCanvas* canvas, int index) { 199 void SkDebugCanvas::drawTo(SkCanvas* canvas, int index, int m) {
200 SkASSERT(!fCommandVector.isEmpty()); 200 SkASSERT(!fCommandVector.isEmpty());
201 SkASSERT(index < fCommandVector.count()); 201 SkASSERT(index < fCommandVector.count());
202 202
203 int saveCount = canvas->save(); 203 int saveCount = canvas->save();
204 204
205 SkRect windowRect = SkRect::MakeWH(SkIntToScalar(canvas->getBaseLayerSize(). width()), 205 SkRect windowRect = SkRect::MakeWH(SkIntToScalar(canvas->getBaseLayerSize(). width()),
206 SkIntToScalar(canvas->getBaseLayerSize(). height())); 206 SkIntToScalar(canvas->getBaseLayerSize(). height()));
207 207
208 bool pathOpsMode = getAllowSimplifyClip(); 208 bool pathOpsMode = getAllowSimplifyClip();
209 canvas->setAllowSimplifyClip(pathOpsMode); 209 canvas->setAllowSimplifyClip(pathOpsMode);
(...skipping 11 matching lines...) Expand all
221 } 221 }
222 222
223 if (fMegaVizMode) { 223 if (fMegaVizMode) {
224 this->markActiveCommands(index); 224 this->markActiveCommands(index);
225 } 225 }
226 226
227 // If we have a GPU backend we can also visualize the batching information 227 // If we have a GPU backend we can also visualize the batching information
228 #if SK_SUPPORT_GPU 228 #if SK_SUPPORT_GPU
229 GrAuditTrail* at = nullptr; 229 GrAuditTrail* at = nullptr;
230 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget(); 230 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget();
231 if (rt && fDrawGpuBatchBounds) { 231 if (rt && (fDrawGpuBatchBounds || m != -1)) {
232 GrContext* ctx = rt->getContext(); 232 GrContext* ctx = rt->getContext();
233 if (ctx) { 233 if (ctx) {
234 at = ctx->getAuditTrail(); 234 at = ctx->getAuditTrail();
235 } 235 }
236 } 236 }
237 #endif 237 #endif
238 238
239 for (int i = 0; i <= index; i++) { 239 for (int i = 0; i <= index; i++) {
240 if (i == index && fFilter) { 240 if (i == index && fFilter) {
241 canvas->clear(0xAAFFFFFF); 241 canvas->clear(0xAAFFFFFF);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 // draw any batches if required and issue a full reset onto GrAuditTrail 332 // draw any batches if required and issue a full reset onto GrAuditTrail
333 if (at) { 333 if (at) {
334 // get the render target of the top device so we can ignore batches draw n offscreen 334 // get the render target of the top device so we can ignore batches draw n offscreen
335 SkBaseDevice* bd = canvas->getDevice_just_for_deprecated_compatibility_t esting(); 335 SkBaseDevice* bd = canvas->getDevice_just_for_deprecated_compatibility_t esting();
336 SkGpuDevice* gbd = reinterpret_cast<SkGpuDevice*>(bd); 336 SkGpuDevice* gbd = reinterpret_cast<SkGpuDevice*>(bd);
337 uint32_t rtID = gbd->accessRenderTarget()->getUniqueID(); 337 uint32_t rtID = gbd->accessRenderTarget()->getUniqueID();
338 338
339 // get the bounding boxes to draw 339 // get the bounding boxes to draw
340 GrAuditTrail::AutoEnable ae(at); 340 GrAuditTrail::AutoEnable ae(at);
341 SkTArray<GrAuditTrail::BatchInfo> childrenBounds; 341 SkTArray<GrAuditTrail::BatchInfo> childrenBounds;
342 at->getBoundsByClientID(&childrenBounds, index); 342 if (m == -1) {
343 at->getBoundsByClientID(&childrenBounds, index);
344 } else {
345 // the client wants us to draw the mth batch
346 at->getBoundsByBatchListID(&childrenBounds.push_back(), m);
347 }
343 SkPaint paint; 348 SkPaint paint;
344 paint.setStyle(SkPaint::kStroke_Style); 349 paint.setStyle(SkPaint::kStroke_Style);
345 paint.setStrokeWidth(1); 350 paint.setStrokeWidth(1);
346 for (int i = 0; i < childrenBounds.count(); i++) { 351 for (int i = 0; i < childrenBounds.count(); i++) {
347 if (childrenBounds[i].fRenderTargetUniqueID != rtID) { 352 if (childrenBounds[i].fRenderTargetUniqueID != rtID) {
348 // offscreen draw, ignore for now 353 // offscreen draw, ignore for now
349 continue; 354 continue;
350 } 355 }
351 paint.setColor(SK_ColorBLACK); 356 paint.setColor(SK_ColorBLACK);
352 canvas->drawRect(childrenBounds[i].fBounds, paint); 357 canvas->drawRect(childrenBounds[i].fBounds, paint);
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 } 721 }
717 722
718 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { 723 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) {
719 if (fCalledAddStackData) { 724 if (fCalledAddStackData) {
720 fClipStackData.appendf("<br>"); 725 fClipStackData.appendf("<br>");
721 addPathData(devPath, "pathOut"); 726 addPathData(devPath, "pathOut");
722 return true; 727 return true;
723 } 728 }
724 return false; 729 return false;
725 } 730 }
OLDNEW
« no previous file with comments | « tools/debugger/SkDebugCanvas.h ('k') | tools/skiaserve/Request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698