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

Side by Side Diff: src/core/SkRecordDraw.cpp

Issue 1211583003: add drawImageNine (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address comments from #9 Created 5 years, 6 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(DrawBitmapRectToRect,
92 drawBitmapRectToRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, 92 drawBitmapRectToRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint,
93 SkCanvas::kNone_DrawBitmapRectFlag)); 93 SkCanvas::kNone_DrawBitmapRectFlag));
94 DRAW(DrawBitmapRectToRectBleed, 94 DRAW(DrawBitmapRectToRectBleed,
95 drawBitmapRectToRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, 95 drawBitmapRectToRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint,
96 SkCanvas::kBleed_DrawBitmapRectFlag)); 96 SkCanvas::kBleed_DrawBitmapRectFlag));
97 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); 97 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint));
98 DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint)); 98 DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint));
99 DRAW(DrawImageRect, drawImageRect(r.image, r.src, r.dst, r.paint)); 99 DRAW(DrawImageRect, drawImageRect(r.image, r.src, r.dst, r.paint));
100 DRAW(DrawImageNine, drawImageNine(r.image, r.center, r.dst, r.paint));
100 DRAW(DrawOval, drawOval(r.oval, r.paint)); 101 DRAW(DrawOval, drawOval(r.oval, r.paint));
101 DRAW(DrawPaint, drawPaint(r.paint)); 102 DRAW(DrawPaint, drawPaint(r.paint));
102 DRAW(DrawPath, drawPath(r.path, r.paint)); 103 DRAW(DrawPath, drawPath(r.path, r.paint));
103 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint)); 104 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint));
104 DRAW(DrawPicture, drawPicture(r.picture, &r.matrix, r.paint)); 105 DRAW(DrawPicture, drawPicture(r.picture, &r.matrix, r.paint));
105 DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint)); 106 DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint));
106 DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); 107 DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint));
107 DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); 108 DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint));
108 DRAW(DrawRRect, drawRRect(r.rrect, r.paint)); 109 DRAW(DrawRRect, drawRRect(r.rrect, r.paint));
109 DRAW(DrawRect, drawRect(r.rect, r.paint)); 110 DRAW(DrawRect, drawRect(r.rect, r.paint));
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 } 407 }
407 Bounds bounds(const DrawImage& op) const { 408 Bounds bounds(const DrawImage& op) const {
408 const SkImage* image = op.image; 409 const SkImage* image = op.image;
409 SkRect rect = SkRect::MakeXYWH(op.left, op.top, image->width(), image->h eight()); 410 SkRect rect = SkRect::MakeXYWH(op.left, op.top, image->width(), image->h eight());
410 411
411 return this->adjustAndMap(rect, op.paint); 412 return this->adjustAndMap(rect, op.paint);
412 } 413 }
413 Bounds bounds(const DrawImageRect& op) const { 414 Bounds bounds(const DrawImageRect& op) const {
414 return this->adjustAndMap(op.dst, op.paint); 415 return this->adjustAndMap(op.dst, op.paint);
415 } 416 }
417 Bounds bounds(const DrawImageNine& op) const {
418 return this->adjustAndMap(op.dst, op.paint);
419 }
416 Bounds bounds(const DrawBitmapRectToRect& op) const { 420 Bounds bounds(const DrawBitmapRectToRect& op) const {
417 return this->adjustAndMap(op.dst, op.paint); 421 return this->adjustAndMap(op.dst, op.paint);
418 } 422 }
419 Bounds bounds(const DrawBitmapRectToRectBleed& op) const { 423 Bounds bounds(const DrawBitmapRectToRectBleed& op) const {
420 return this->adjustAndMap(op.dst, op.paint); 424 return this->adjustAndMap(op.dst, op.paint);
421 } 425 }
422 Bounds bounds(const DrawBitmapNine& op) const { 426 Bounds bounds(const DrawBitmapNine& op) const {
423 return this->adjustAndMap(op.dst, op.paint); 427 return this->adjustAndMap(op.dst, op.paint);
424 } 428 }
425 Bounds bounds(const DrawBitmap& op) const { 429 Bounds bounds(const DrawBitmap& op) const {
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); 804 SkRecords::CollectLayers visitor(cullRect, record, pictList, data);
801 805
802 for (unsigned curOp = 0; curOp < record.count(); curOp++) { 806 for (unsigned curOp = 0; curOp < record.count(); curOp++) {
803 visitor.setCurrentOp(curOp); 807 visitor.setCurrentOp(curOp);
804 record.visit<void>(curOp, visitor); 808 record.visit<void>(curOp, visitor);
805 } 809 }
806 810
807 visitor.cleanUp(bbh); 811 visitor.cleanUp(bbh);
808 } 812 }
809 813
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