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

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

Issue 1239193002: remove all guards for changes to drawBitmapRect / drawImageRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 4 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 | « src/utils/SkDeferredCanvas.cpp ('k') | src/utils/SkLuaCanvas.cpp » ('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 /* 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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 339
340 void SkDumpCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, 340 void SkDumpCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y,
341 const SkPaint* paint) { 341 const SkPaint* paint) {
342 SkString str; 342 SkString str;
343 bitmap.toString(&str); 343 bitmap.toString(&str);
344 this->dump(kDrawBitmap_Verb, paint, "drawBitmap(%s %g %g)", str.c_str(), 344 this->dump(kDrawBitmap_Verb, paint, "drawBitmap(%s %g %g)", str.c_str(),
345 SkScalarToFloat(x), SkScalarToFloat(y)); 345 SkScalarToFloat(x), SkScalarToFloat(y));
346 } 346 }
347 347
348 void SkDumpCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, c onst SkRect& dst, 348 void SkDumpCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, c onst SkRect& dst,
349 const SkPaint* paint, SK_VIRTUAL_CONSTRAINT_ TYPE) { 349 const SkPaint* paint, SrcRectConstraint) {
350 SkString bs, rs; 350 SkString bs, rs;
351 bitmap.toString(&bs); 351 bitmap.toString(&bs);
352 toString(dst, &rs); 352 toString(dst, &rs);
353 // show the src-rect only if its not everything 353 // show the src-rect only if its not everything
354 if (src && (src->fLeft > 0 || src->fTop > 0 || 354 if (src && (src->fLeft > 0 || src->fTop > 0 ||
355 src->fRight < SkIntToScalar(bitmap.width()) || 355 src->fRight < SkIntToScalar(bitmap.width()) ||
356 src->fBottom < SkIntToScalar(bitmap.height()))) { 356 src->fBottom < SkIntToScalar(bitmap.height()))) {
357 SkString ss; 357 SkString ss;
358 toString(*src, &ss); 358 toString(*src, &ss);
359 rs.prependf("%s ", ss.c_str()); 359 rs.prependf("%s ", ss.c_str());
(...skipping 13 matching lines...) Expand all
373 } 373 }
374 374
375 void SkDumpCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, con st SkPaint* paint) { 375 void SkDumpCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, con st SkPaint* paint) {
376 SkString str; 376 SkString str;
377 image->toString(&str); 377 image->toString(&str);
378 this->dump(kDrawBitmap_Verb, paint, "drawImage(%s %g %g)", str.c_str(), 378 this->dump(kDrawBitmap_Verb, paint, "drawImage(%s %g %g)", str.c_str(),
379 SkScalarToFloat(x), SkScalarToFloat(y)); 379 SkScalarToFloat(x), SkScalarToFloat(y));
380 } 380 }
381 381
382 void SkDumpCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, cons t SkRect& dst, 382 void SkDumpCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, cons t SkRect& dst,
383 const SkPaint* paint SRC_RECT_CONSTRAINT_PARA M(constraint)) { 383 const SkPaint* paint, SrcRectConstraint) {
384 SkString bs, rs; 384 SkString bs, rs;
385 image->toString(&bs); 385 image->toString(&bs);
386 toString(dst, &rs); 386 toString(dst, &rs);
387 // show the src-rect only if its not everything 387 // show the src-rect only if its not everything
388 if (src && (src->fLeft > 0 || src->fTop > 0 || 388 if (src && (src->fLeft > 0 || src->fTop > 0 ||
389 src->fRight < SkIntToScalar(image->width()) || 389 src->fRight < SkIntToScalar(image->width()) ||
390 src->fBottom < SkIntToScalar(image->height()))) { 390 src->fBottom < SkIntToScalar(image->height()))) {
391 SkString ss; 391 SkString ss;
392 toString(*src, &ss); 392 toString(*src, &ss);
393 rs.prependf("%s ", ss.c_str()); 393 rs.prependf("%s ", ss.c_str());
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 548
549 /////////////////////////////////////////////////////////////////////////////// 549 ///////////////////////////////////////////////////////////////////////////////
550 550
551 static void dumpToDebugf(const char text[], void*) { 551 static void dumpToDebugf(const char text[], void*) {
552 SkDebugf("%s\n", text); 552 SkDebugf("%s\n", text);
553 } 553 }
554 554
555 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} 555 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {}
556 556
557 #endif 557 #endif
OLDNEW
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | src/utils/SkLuaCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698