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

Side by Side Diff: src/pipe/SkGPipeRead.cpp

Issue 1530203002: Reland of move drawSprite from canvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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/pipe/SkGPipePriv.h ('k') | src/pipe/SkGPipeWrite.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 9
10 #include "SkBitmapHeap.h" 10 #include "SkBitmapHeap.h"
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 if (flags & kDrawBitmap_Bleed_DrawOpFlag) { 647 if (flags & kDrawBitmap_Bleed_DrawOpFlag) {
648 constraint = SkCanvas::kFast_SrcRectConstraint; 648 constraint = SkCanvas::kFast_SrcRectConstraint;
649 } 649 }
650 const SkRect* dst = skip<SkRect>(reader); 650 const SkRect* dst = skip<SkRect>(reader);
651 const SkBitmap* bitmap = holder.getBitmap(); 651 const SkBitmap* bitmap = holder.getBitmap();
652 if (state->shouldDraw()) { 652 if (state->shouldDraw()) {
653 canvas->legacy_drawBitmapRect(*bitmap, src, *dst, hasPaint ? &state->pai nt() : nullptr, constraint); 653 canvas->legacy_drawBitmapRect(*bitmap, src, *dst, hasPaint ? &state->pai nt() : nullptr, constraint);
654 } 654 }
655 } 655 }
656 656
657 static void drawSprite_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
658 SkGPipeState* state) {
659 BitmapHolder holder(reader, op32, state);
660 bool hasPaint = SkToBool(DrawOp_unpackFlags(op32) & kDrawBitmap_HasPaint_Dra wOpFlag);
661 const SkIPoint* point = skip<SkIPoint>(reader);
662 const SkBitmap* bitmap = holder.getBitmap();
663 if (state->shouldDraw()) {
664 canvas->drawSprite(*bitmap, point->fX, point->fY, hasPaint ? &state->pai nt() : nullptr);
665 }
666 }
667
668 static void drawImage_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, Sk GPipeState* state) { 657 static void drawImage_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, Sk GPipeState* state) {
669 unsigned slot = DrawOp_unpackData(op32); 658 unsigned slot = DrawOp_unpackData(op32);
670 unsigned flags = DrawOp_unpackFlags(op32); 659 unsigned flags = DrawOp_unpackFlags(op32);
671 bool hasPaint = SkToBool(flags & kDrawBitmap_HasPaint_DrawOpFlag); 660 bool hasPaint = SkToBool(flags & kDrawBitmap_HasPaint_DrawOpFlag);
672 SkScalar x = reader->readScalar(); 661 SkScalar x = reader->readScalar();
673 SkScalar y = reader->readScalar(); 662 SkScalar y = reader->readScalar();
674 const SkImage* image = state->getImage(slot); 663 const SkImage* image = state->getImage(slot);
675 if (state->shouldDraw()) { 664 if (state->shouldDraw()) {
676 canvas->drawImage(image, x, y, hasPaint ? &state->paint() : nullptr); 665 canvas->drawImage(image, x, y, hasPaint ? &state->paint() : nullptr);
677 } 666 }
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 drawOval_rp, 873 drawOval_rp,
885 drawPaint_rp, 874 drawPaint_rp,
886 drawPatch_rp, 875 drawPatch_rp,
887 drawPath_rp, 876 drawPath_rp,
888 drawPicture_rp, 877 drawPicture_rp,
889 drawPoints_rp, 878 drawPoints_rp,
890 drawPosText_rp, 879 drawPosText_rp,
891 drawPosTextH_rp, 880 drawPosTextH_rp,
892 drawRect_rp, 881 drawRect_rp,
893 drawRRect_rp, 882 drawRRect_rp,
894 drawSprite_rp,
895 drawText_rp, 883 drawText_rp,
896 drawTextBlob_rp, 884 drawTextBlob_rp,
897 drawTextOnPath_rp, 885 drawTextOnPath_rp,
898 drawVertices_rp, 886 drawVertices_rp,
899 restore_rp, 887 restore_rp,
900 rotate_rp, 888 rotate_rp,
901 save_rp, 889 save_rp,
902 saveLayer_rp, 890 saveLayer_rp,
903 scale_rp, 891 scale_rp,
904 setMatrix_rp, 892 setMatrix_rp,
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 status = kReadAtom_Status; 996 status = kReadAtom_Status;
1009 break; 997 break;
1010 } 998 }
1011 } 999 }
1012 1000
1013 if (bytesRead) { 1001 if (bytesRead) {
1014 *bytesRead = reader.offset(); 1002 *bytesRead = reader.offset();
1015 } 1003 }
1016 return status; 1004 return status;
1017 } 1005 }
OLDNEW
« no previous file with comments | « src/pipe/SkGPipePriv.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698