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

Side by Side Diff: src/core/SkRecordDraw.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/core/SkPictureRecord.cpp ('k') | src/core/SkRecorder.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 2014 Google Inc. 2 * Copyright 2014 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 "SkLayerInfo.h" 8 #include "SkLayerInfo.h"
9 #include "SkRecordDraw.h" 9 #include "SkRecordDraw.h"
10 #include "SkPatchUtils.h" 10 #include "SkPatchUtils.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 DRAW(SaveLayer, saveLayer(r.bounds, r.paint, r.flags)); 81 DRAW(SaveLayer, saveLayer(r.bounds, r.paint, r.flags));
82 DRAW(SetMatrix, setMatrix(SkMatrix::Concat(fInitialCTM, r.matrix))); 82 DRAW(SetMatrix, setMatrix(SkMatrix::Concat(fInitialCTM, r.matrix)));
83 83
84 DRAW(ClipPath, clipPath(r.path, r.opAA.op, r.opAA.aa)); 84 DRAW(ClipPath, clipPath(r.path, r.opAA.op, r.opAA.aa));
85 DRAW(ClipRRect, clipRRect(r.rrect, r.opAA.op, r.opAA.aa)); 85 DRAW(ClipRRect, clipRRect(r.rrect, r.opAA.op, r.opAA.aa));
86 DRAW(ClipRect, clipRect(r.rect, r.opAA.op, r.opAA.aa)); 86 DRAW(ClipRect, clipRect(r.rect, r.opAA.op, r.opAA.aa));
87 DRAW(ClipRegion, clipRegion(r.region, r.op)); 87 DRAW(ClipRegion, clipRegion(r.region, r.op));
88 88
89 DRAW(DrawBitmap, drawBitmap(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); 89 DRAW(DrawBitmap, drawBitmap(r.bitmap.shallowCopy(), r.left, r.top, r.paint));
90 DRAW(DrawBitmapNine, drawBitmapNine(r.bitmap.shallowCopy(), r.center, r.dst, r.p aint)); 90 DRAW(DrawBitmapNine, drawBitmapNine(r.bitmap.shallowCopy(), r.center, r.dst, r.p aint));
91 DRAW(DrawBitmapRectToRect, 91 DRAW(DrawBitmapRect,
92 drawBitmapRectToRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, 92 drawBitmapRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint,
93 SkCanvas::kNone_DrawBitmapRectFlag)); 93 SkCanvas::kStrict_SrcRectConstraint));
94 DRAW(DrawBitmapRectToRectBleed, 94 DRAW(DrawBitmapRectFast,
95 drawBitmapRectToRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, 95 drawBitmapRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint,
96 SkCanvas::kBleed_DrawBitmapRectFlag)); 96 SkCanvas::kFast_SrcRectConstraint));
97 DRAW(DrawBitmapRectToRectFixedSize, 97 DRAW(DrawBitmapRectFixedSize,
98 drawBitmapRectToRect(r.bitmap.shallowCopy(), &r.src, r.dst, &r.paint, r. flags)); 98 drawBitmapRect(r.bitmap.shallowCopy(), &r.src, r.dst, &r.paint, r.constr aint));
99 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); 99 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint));
100 DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint)); 100 DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint));
101 DRAW(DrawImageRect, drawImageRect(r.image, r.src, r.dst, r.paint)); 101 DRAW(DrawImageRect, drawImageRect(r.image, r.src, r.dst, r.paint));
102 DRAW(DrawImageNine, drawImageNine(r.image, r.center, r.dst, r.paint)); 102 DRAW(DrawImageNine, drawImageNine(r.image, r.center, r.dst, r.paint));
103 DRAW(DrawOval, drawOval(r.oval, r.paint)); 103 DRAW(DrawOval, drawOval(r.oval, r.paint));
104 DRAW(DrawPaint, drawPaint(r.paint)); 104 DRAW(DrawPaint, drawPaint(r.paint));
105 DRAW(DrawPath, drawPath(r.path, r.paint)); 105 DRAW(DrawPath, drawPath(r.path, r.paint));
106 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint)); 106 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint));
107 DRAW(DrawPicture, drawPicture(r.picture, &r.matrix, r.paint)); 107 DRAW(DrawPicture, drawPicture(r.picture, &r.matrix, r.paint));
108 DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint)); 108 DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint));
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 SkRect rect = SkRect::MakeXYWH(op.left, op.top, image->width(), image->h eight()); 412 SkRect rect = SkRect::MakeXYWH(op.left, op.top, image->width(), image->h eight());
413 413
414 return this->adjustAndMap(rect, op.paint); 414 return this->adjustAndMap(rect, op.paint);
415 } 415 }
416 Bounds bounds(const DrawImageRect& op) const { 416 Bounds bounds(const DrawImageRect& op) const {
417 return this->adjustAndMap(op.dst, op.paint); 417 return this->adjustAndMap(op.dst, op.paint);
418 } 418 }
419 Bounds bounds(const DrawImageNine& op) const { 419 Bounds bounds(const DrawImageNine& op) const {
420 return this->adjustAndMap(op.dst, op.paint); 420 return this->adjustAndMap(op.dst, op.paint);
421 } 421 }
422 Bounds bounds(const DrawBitmapRectToRect& op) const { 422 Bounds bounds(const DrawBitmapRect& op) const {
423 return this->adjustAndMap(op.dst, op.paint); 423 return this->adjustAndMap(op.dst, op.paint);
424 } 424 }
425 Bounds bounds(const DrawBitmapRectToRectBleed& op) const { 425 Bounds bounds(const DrawBitmapRectFast& op) const {
426 return this->adjustAndMap(op.dst, op.paint); 426 return this->adjustAndMap(op.dst, op.paint);
427 } 427 }
428 Bounds bounds(const DrawBitmapRectToRectFixedSize& op) const { 428 Bounds bounds(const DrawBitmapRectFixedSize& op) const {
429 return this->adjustAndMap(op.dst, &op.paint); 429 return this->adjustAndMap(op.dst, &op.paint);
430 } 430 }
431 Bounds bounds(const DrawBitmapNine& op) const { 431 Bounds bounds(const DrawBitmapNine& op) const {
432 return this->adjustAndMap(op.dst, op.paint); 432 return this->adjustAndMap(op.dst, op.paint);
433 } 433 }
434 Bounds bounds(const DrawBitmap& op) const { 434 Bounds bounds(const DrawBitmap& op) const {
435 return this->adjustAndMap( 435 return this->adjustAndMap(
436 SkRect::MakeXYWH(op.left, op.top, op.bitmap.width(), op.bitmap.h eight()), 436 SkRect::MakeXYWH(op.left, op.top, op.bitmap.width(), op.bitmap.h eight()),
437 op.paint); 437 op.paint);
438 } 438 }
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); 809 SkRecords::CollectLayers visitor(cullRect, record, pictList, data);
810 810
811 for (unsigned curOp = 0; curOp < record.count(); curOp++) { 811 for (unsigned curOp = 0; curOp < record.count(); curOp++) {
812 visitor.setCurrentOp(curOp); 812 visitor.setCurrentOp(curOp);
813 record.visit<void>(curOp, visitor); 813 record.visit<void>(curOp, visitor);
814 } 814 }
815 815
816 visitor.cleanUp(bbh); 816 visitor.cleanUp(bbh);
817 } 817 }
818 818
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.cpp ('k') | src/core/SkRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698