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

Side by Side Diff: src/svg/SkSVGDevice.cpp

Issue 1228083004: add src-rect-constraint to drawImageRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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
« no previous file with comments | « src/svg/SkSVGDevice.h ('k') | src/utils/SkDeferredCanvas.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 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "SkSVGDevice.h" 8 #include "SkSVGDevice.h"
9 9
10 #include "SkBase64.h" 10 #include "SkBase64.h"
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 SkMatrix adjustedMatrix = *draw.fMatrix; 709 SkMatrix adjustedMatrix = *draw.fMatrix;
710 adjustedMatrix.preTranslate(SkIntToScalar(x), SkIntToScalar(y)); 710 adjustedMatrix.preTranslate(SkIntToScalar(x), SkIntToScalar(y));
711 SkDraw adjustedDraw(draw); 711 SkDraw adjustedDraw(draw);
712 adjustedDraw.fMatrix = &adjustedMatrix; 712 adjustedDraw.fMatrix = &adjustedMatrix;
713 713
714 drawBitmapCommon(adjustedDraw, bitmap, paint); 714 drawBitmapCommon(adjustedDraw, bitmap, paint);
715 } 715 }
716 716
717 void SkSVGDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bm, const S kRect* srcOrNull, 717 void SkSVGDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bm, const S kRect* srcOrNull,
718 const SkRect& dst, const SkPaint& paint, 718 const SkRect& dst, const SkPaint& paint,
719 SkCanvas::DrawBitmapRectFlags) { 719 SK_VIRTUAL_CONSTRAINT_TYPE) {
720 SkMatrix adjustedMatrix; 720 SkMatrix adjustedMatrix;
721 adjustedMatrix.setRectToRect(srcOrNull ? *srcOrNull : SkRect::Make(bm.bounds ()), 721 adjustedMatrix.setRectToRect(srcOrNull ? *srcOrNull : SkRect::Make(bm.bounds ()),
722 dst, 722 dst,
723 SkMatrix::kFill_ScaleToFit); 723 SkMatrix::kFill_ScaleToFit);
724 adjustedMatrix.postConcat(*draw.fMatrix); 724 adjustedMatrix.postConcat(*draw.fMatrix);
725 725
726 SkDraw adjustedDraw(draw); 726 SkDraw adjustedDraw(draw);
727 adjustedDraw.fMatrix = &adjustedMatrix; 727 adjustedDraw.fMatrix = &adjustedMatrix;
728 728
729 SkClipStack adjustedClipStack; 729 SkClipStack adjustedClipStack;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 const SkPaint& paint) { 808 const SkPaint& paint) {
809 // todo 809 // todo
810 SkDebugf("unsupported operation: drawVertices()\n"); 810 SkDebugf("unsupported operation: drawVertices()\n");
811 } 811 }
812 812
813 void SkSVGDevice::drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, 813 void SkSVGDevice::drawDevice(const SkDraw&, SkBaseDevice*, int x, int y,
814 const SkPaint&) { 814 const SkPaint&) {
815 // todo 815 // todo
816 SkDebugf("unsupported operation: drawDevice()\n"); 816 SkDebugf("unsupported operation: drawDevice()\n");
817 } 817 }
OLDNEW
« no previous file with comments | « src/svg/SkSVGDevice.h ('k') | src/utils/SkDeferredCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698