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

Side by Side Diff: src/utils/SkDumpCanvas.cpp

Issue 1228083004: add src-rect-constraint to drawImageRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: propogate Constraint into SkDevice Created 5 years, 5 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkDumpCanvas.h" 9 #include "SkDumpCanvas.h"
10 10
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 } 374 }
375 375
376 void SkDumpCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, con st SkPaint* paint) { 376 void SkDumpCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, con st SkPaint* paint) {
377 SkString str; 377 SkString str;
378 image->toString(&str); 378 image->toString(&str);
379 this->dump(kDrawBitmap_Verb, paint, "drawImage(%s %g %g)", str.c_str(), 379 this->dump(kDrawBitmap_Verb, paint, "drawImage(%s %g %g)", str.c_str(),
380 SkScalarToFloat(x), SkScalarToFloat(y)); 380 SkScalarToFloat(x), SkScalarToFloat(y));
381 } 381 }
382 382
383 void SkDumpCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, cons t SkRect& dst, 383 void SkDumpCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, cons t SkRect& dst,
384 const SkPaint* paint) { 384 const SkPaint* paint SRC_RECT_CONSTRAINT_PARA M(constraint)) {
385 SkString bs, rs; 385 SkString bs, rs;
386 image->toString(&bs); 386 image->toString(&bs);
387 toString(dst, &rs); 387 toString(dst, &rs);
388 // show the src-rect only if its not everything 388 // show the src-rect only if its not everything
389 if (src && (src->fLeft > 0 || src->fTop > 0 || 389 if (src && (src->fLeft > 0 || src->fTop > 0 ||
390 src->fRight < SkIntToScalar(image->width()) || 390 src->fRight < SkIntToScalar(image->width()) ||
391 src->fBottom < SkIntToScalar(image->height()))) { 391 src->fBottom < SkIntToScalar(image->height()))) {
392 SkString ss; 392 SkString ss;
393 toString(*src, &ss); 393 toString(*src, &ss);
394 rs.prependf("%s ", ss.c_str()); 394 rs.prependf("%s ", ss.c_str());
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 549
550 /////////////////////////////////////////////////////////////////////////////// 550 ///////////////////////////////////////////////////////////////////////////////
551 551
552 static void dumpToDebugf(const char text[], void*) { 552 static void dumpToDebugf(const char text[], void*) {
553 SkDebugf("%s\n", text); 553 SkDebugf("%s\n", text);
554 } 554 }
555 555
556 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} 556 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {}
557 557
558 #endif 558 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698