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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 BitmapHolder holder(reader, op32, state); | 583 BitmapHolder holder(reader, op32, state); |
584 bool hasPaint = SkToBool(DrawOp_unpackFlags(op32) & kDrawBitmap_HasPaint_Dra
wOpFlag); | 584 bool hasPaint = SkToBool(DrawOp_unpackFlags(op32) & kDrawBitmap_HasPaint_Dra
wOpFlag); |
585 SkScalar left = reader->readScalar(); | 585 SkScalar left = reader->readScalar(); |
586 SkScalar top = reader->readScalar(); | 586 SkScalar top = reader->readScalar(); |
587 const SkBitmap* bitmap = holder.getBitmap(); | 587 const SkBitmap* bitmap = holder.getBitmap(); |
588 if (state->shouldDraw()) { | 588 if (state->shouldDraw()) { |
589 canvas->drawBitmap(*bitmap, left, top, hasPaint ? &state->paint() : NULL
); | 589 canvas->drawBitmap(*bitmap, left, top, hasPaint ? &state->paint() : NULL
); |
590 } | 590 } |
591 } | 591 } |
592 | 592 |
593 static void drawBitmapMatrix_rp(SkCanvas* canvas, SkReader32* reader, uint32_t o
p32, | |
594 SkGPipeState* state) { | |
595 BitmapHolder holder(reader, op32, state); | |
596 bool hasPaint = SkToBool(DrawOp_unpackFlags(op32) & kDrawBitmap_HasPaint_Dra
wOpFlag); | |
597 SkMatrix matrix; | |
598 reader->readMatrix(&matrix); | |
599 const SkBitmap* bitmap = holder.getBitmap(); | |
600 if (state->shouldDraw()) { | |
601 canvas->drawBitmapMatrix(*bitmap, matrix, | |
602 hasPaint ? &state->paint() : NULL); | |
603 } | |
604 } | |
605 | |
606 static void drawBitmapNine_rp(SkCanvas* canvas, SkReader32* reader, | 593 static void drawBitmapNine_rp(SkCanvas* canvas, SkReader32* reader, |
607 uint32_t op32, SkGPipeState* state) { | 594 uint32_t op32, SkGPipeState* state) { |
608 BitmapHolder holder(reader, op32, state); | 595 BitmapHolder holder(reader, op32, state); |
609 bool hasPaint = SkToBool(DrawOp_unpackFlags(op32) & kDrawBitmap_HasPaint_Dra
wOpFlag); | 596 bool hasPaint = SkToBool(DrawOp_unpackFlags(op32) & kDrawBitmap_HasPaint_Dra
wOpFlag); |
610 const SkIRect* center = skip<SkIRect>(reader); | 597 const SkIRect* center = skip<SkIRect>(reader); |
611 const SkRect* dst = skip<SkRect>(reader); | 598 const SkRect* dst = skip<SkRect>(reader); |
612 const SkBitmap* bitmap = holder.getBitmap(); | 599 const SkBitmap* bitmap = holder.getBitmap(); |
613 if (state->shouldDraw()) { | 600 if (state->shouldDraw()) { |
614 canvas->drawBitmapNine(*bitmap, *center, *dst, | 601 canvas->drawBitmapNine(*bitmap, *center, *dst, |
615 hasPaint ? &state->paint() : NULL); | 602 hasPaint ? &state->paint() : NULL); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 typedef void (*ReadProc)(SkCanvas*, SkReader32*, uint32_t op32, SkGPipeState*); | 805 typedef void (*ReadProc)(SkCanvas*, SkReader32*, uint32_t op32, SkGPipeState*); |
819 | 806 |
820 static const ReadProc gReadTable[] = { | 807 static const ReadProc gReadTable[] = { |
821 skip_rp, | 808 skip_rp, |
822 clipPath_rp, | 809 clipPath_rp, |
823 clipRegion_rp, | 810 clipRegion_rp, |
824 clipRect_rp, | 811 clipRect_rp, |
825 clipRRect_rp, | 812 clipRRect_rp, |
826 concat_rp, | 813 concat_rp, |
827 drawBitmap_rp, | 814 drawBitmap_rp, |
828 drawBitmapMatrix_rp, | |
829 drawBitmapNine_rp, | 815 drawBitmapNine_rp, |
830 drawBitmapRect_rp, | 816 drawBitmapRect_rp, |
831 drawClear_rp, | 817 drawClear_rp, |
832 drawData_rp, | 818 drawData_rp, |
833 drawDRRect_rp, | 819 drawDRRect_rp, |
834 drawOval_rp, | 820 drawOval_rp, |
835 drawPaint_rp, | 821 drawPaint_rp, |
836 drawPatch_rp, | 822 drawPatch_rp, |
837 drawPath_rp, | 823 drawPath_rp, |
838 drawPicture_rp, | 824 drawPicture_rp, |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 status = kReadAtom_Status; | 943 status = kReadAtom_Status; |
958 break; | 944 break; |
959 } | 945 } |
960 } | 946 } |
961 | 947 |
962 if (bytesRead) { | 948 if (bytesRead) { |
963 *bytesRead = reader.offset(); | 949 *bytesRead = reader.offset(); |
964 } | 950 } |
965 return status; | 951 return status; |
966 } | 952 } |
OLD | NEW |