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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 bool hasPaint = SkToBool(DrawOp_unpackFlags(op32) & kDrawBitmap_HasPaint_Dra
wOpFlag); | 633 bool hasPaint = SkToBool(DrawOp_unpackFlags(op32) & kDrawBitmap_HasPaint_Dra
wOpFlag); |
634 const SkIPoint* point = skip<SkIPoint>(reader); | 634 const SkIPoint* point = skip<SkIPoint>(reader); |
635 const SkBitmap* bitmap = holder.getBitmap(); | 635 const SkBitmap* bitmap = holder.getBitmap(); |
636 if (state->shouldDraw()) { | 636 if (state->shouldDraw()) { |
637 canvas->drawSprite(*bitmap, point->fX, point->fY, hasPaint ? &state->pai
nt() : NULL); | 637 canvas->drawSprite(*bitmap, point->fX, point->fY, hasPaint ? &state->pai
nt() : NULL); |
638 } | 638 } |
639 } | 639 } |
640 | 640 |
641 /////////////////////////////////////////////////////////////////////////////// | 641 /////////////////////////////////////////////////////////////////////////////// |
642 | 642 |
643 static void drawData_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, | |
644 SkGPipeState* state) { | |
645 // since we don't have a paint, we can use data for our (small) sizes | |
646 size_t size = DrawOp_unpackData(op32); | |
647 if (0 == size) { | |
648 size = reader->readU32(); | |
649 } | |
650 const void* data = reader->skip(SkAlign4(size)); | |
651 if (state->shouldDraw()) { | |
652 canvas->drawData(data, size); | |
653 } | |
654 } | |
655 | |
656 static void drawPicture_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, | 643 static void drawPicture_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, |
657 SkGPipeState* state) { | 644 SkGPipeState* state) { |
658 UNIMPLEMENTED | 645 UNIMPLEMENTED |
659 } | 646 } |
660 | 647 |
661 static void drawTextBlob_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, | 648 static void drawTextBlob_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, |
662 SkGPipeState* state) { | 649 SkGPipeState* state) { |
663 SkScalar x = reader->readScalar(); | 650 SkScalar x = reader->readScalar(); |
664 SkScalar y = reader->readScalar(); | 651 SkScalar y = reader->readScalar(); |
665 | 652 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 skip_rp, | 795 skip_rp, |
809 clipPath_rp, | 796 clipPath_rp, |
810 clipRegion_rp, | 797 clipRegion_rp, |
811 clipRect_rp, | 798 clipRect_rp, |
812 clipRRect_rp, | 799 clipRRect_rp, |
813 concat_rp, | 800 concat_rp, |
814 drawBitmap_rp, | 801 drawBitmap_rp, |
815 drawBitmapNine_rp, | 802 drawBitmapNine_rp, |
816 drawBitmapRect_rp, | 803 drawBitmapRect_rp, |
817 drawClear_rp, | 804 drawClear_rp, |
818 drawData_rp, | |
819 drawDRRect_rp, | 805 drawDRRect_rp, |
820 drawOval_rp, | 806 drawOval_rp, |
821 drawPaint_rp, | 807 drawPaint_rp, |
822 drawPatch_rp, | 808 drawPatch_rp, |
823 drawPath_rp, | 809 drawPath_rp, |
824 drawPicture_rp, | 810 drawPicture_rp, |
825 drawPoints_rp, | 811 drawPoints_rp, |
826 drawPosText_rp, | 812 drawPosText_rp, |
827 drawPosTextH_rp, | 813 drawPosTextH_rp, |
828 drawRect_rp, | 814 drawRect_rp, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 status = kReadAtom_Status; | 929 status = kReadAtom_Status; |
944 break; | 930 break; |
945 } | 931 } |
946 } | 932 } |
947 | 933 |
948 if (bytesRead) { | 934 if (bytesRead) { |
949 *bytesRead = reader.offset(); | 935 *bytesRead = reader.offset(); |
950 } | 936 } |
951 return status; | 937 return status; |
952 } | 938 } |
OLD | NEW |