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

Side by Side Diff: src/pipe/SkGPipeRead.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/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 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 if (hasSrc) { 688 if (hasSrc) {
689 src = skip<SkRect>(reader); 689 src = skip<SkRect>(reader);
690 } 690 }
691 const SkRect* dst = skip<SkRect>(reader); 691 const SkRect* dst = skip<SkRect>(reader);
692 const SkImage* image = state->getImage(slot); 692 const SkImage* image = state->getImage(slot);
693 if (state->shouldDraw()) { 693 if (state->shouldDraw()) {
694 canvas->drawImageRect(image, src, *dst, hasPaint ? &state->paint() : NUL L); 694 canvas->drawImageRect(image, src, *dst, hasPaint ? &state->paint() : NUL L);
695 } 695 }
696 } 696 }
697 697
698 static void drawImageNine_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32 ,
699 SkGPipeState* state) {
700 unsigned slot = DrawOp_unpackData(op32);
701 unsigned flags = DrawOp_unpackFlags(op32);
702 bool hasPaint = SkToBool(flags & kDrawBitmap_HasPaint_DrawOpFlag);
703 const SkIRect* center = skip<SkIRect>(reader);
704 const SkRect* dst = skip<SkRect>(reader);
705 const SkImage* image = state->getImage(slot);
706 if (state->shouldDraw()) {
707 canvas->drawImageNine(image, *center, *dst, hasPaint ? &state->paint() : NULL);
708 }
709 }
710
698 /////////////////////////////////////////////////////////////////////////////// 711 ///////////////////////////////////////////////////////////////////////////////
699 712
700 static void drawPicture_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, 713 static void drawPicture_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
701 SkGPipeState* state) { 714 SkGPipeState* state) {
702 UNIMPLEMENTED 715 UNIMPLEMENTED
703 } 716 }
704 717
705 static void drawTextBlob_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, 718 static void drawTextBlob_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
706 SkGPipeState* state) { 719 SkGPipeState* state) {
707 SkScalar x = reader->readScalar(); 720 SkScalar x = reader->readScalar();
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 clipRect_rp, 872 clipRect_rp,
860 clipRRect_rp, 873 clipRRect_rp,
861 concat_rp, 874 concat_rp,
862 drawAtlas_rp, 875 drawAtlas_rp,
863 drawBitmap_rp, 876 drawBitmap_rp,
864 drawBitmapNine_rp, 877 drawBitmapNine_rp,
865 drawBitmapRect_rp, 878 drawBitmapRect_rp,
866 drawDRRect_rp, 879 drawDRRect_rp,
867 drawImage_rp, 880 drawImage_rp,
868 drawImageRect_rp, 881 drawImageRect_rp,
882 drawImageNine_rp,
869 drawOval_rp, 883 drawOval_rp,
870 drawPaint_rp, 884 drawPaint_rp,
871 drawPatch_rp, 885 drawPatch_rp,
872 drawPath_rp, 886 drawPath_rp,
873 drawPicture_rp, 887 drawPicture_rp,
874 drawPoints_rp, 888 drawPoints_rp,
875 drawPosText_rp, 889 drawPosText_rp,
876 drawPosTextH_rp, 890 drawPosTextH_rp,
877 drawRect_rp, 891 drawRect_rp,
878 drawRRect_rp, 892 drawRRect_rp,
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 status = kReadAtom_Status; 1007 status = kReadAtom_Status;
994 break; 1008 break;
995 } 1009 }
996 } 1010 }
997 1011
998 if (bytesRead) { 1012 if (bytesRead) {
999 *bytesRead = reader.offset(); 1013 *bytesRead = reader.offset();
1000 } 1014 }
1001 return status; 1015 return status;
1002 } 1016 }
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