OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |