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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 BitmapHolder holder(reader, op32, state); | 565 BitmapHolder holder(reader, op32, state); |
566 unsigned flags = DrawOp_unpackFlags(op32); | 566 unsigned flags = DrawOp_unpackFlags(op32); |
567 bool hasPaint = SkToBool(flags & kDrawBitmap_HasPaint_DrawOpFlag); | 567 bool hasPaint = SkToBool(flags & kDrawBitmap_HasPaint_DrawOpFlag); |
568 bool hasSrc = SkToBool(flags & kDrawBitmap_HasSrcRect_DrawOpFlag); | 568 bool hasSrc = SkToBool(flags & kDrawBitmap_HasSrcRect_DrawOpFlag); |
569 const SkRect* src; | 569 const SkRect* src; |
570 if (hasSrc) { | 570 if (hasSrc) { |
571 src = skip<SkRect>(reader); | 571 src = skip<SkRect>(reader); |
572 } else { | 572 } else { |
573 src = NULL; | 573 src = NULL; |
574 } | 574 } |
| 575 SkCanvas::DrawBitmapRectFlags dbmrFlags = SkCanvas::kNone_DrawBitmapRectflag
; |
| 576 if (flags & kDrawBitmap_Bleed_DrawOpFlag) { |
| 577 dbmrFlags = (SkCanvas::DrawBitmapRectFlags)(dbmrFlags|SkCanvas::kBleed_D
rawBitmapRectFlag); |
| 578 } |
575 const SkRect* dst = skip<SkRect>(reader); | 579 const SkRect* dst = skip<SkRect>(reader); |
576 const SkBitmap* bitmap = holder.getBitmap(); | 580 const SkBitmap* bitmap = holder.getBitmap(); |
577 if (state->shouldDraw()) { | 581 if (state->shouldDraw()) { |
578 canvas->drawBitmapRectToRect(*bitmap, src, *dst, hasPaint ? &state->pain
t() : NULL); | 582 canvas->drawBitmapRectToRect(*bitmap, src, *dst, |
| 583 hasPaint ? &state->paint() : NULL, dbmrFlag
s); |
579 } | 584 } |
580 } | 585 } |
581 | 586 |
582 static void drawSprite_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, | 587 static void drawSprite_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, |
583 SkGPipeState* state) { | 588 SkGPipeState* state) { |
584 BitmapHolder holder(reader, op32, state); | 589 BitmapHolder holder(reader, op32, state); |
585 bool hasPaint = SkToBool(DrawOp_unpackFlags(op32) & kDrawBitmap_HasPaint_Dra
wOpFlag); | 590 bool hasPaint = SkToBool(DrawOp_unpackFlags(op32) & kDrawBitmap_HasPaint_Dra
wOpFlag); |
586 const SkIPoint* point = skip<SkIPoint>(reader); | 591 const SkIPoint* point = skip<SkIPoint>(reader); |
587 const SkBitmap* bitmap = holder.getBitmap(); | 592 const SkBitmap* bitmap = holder.getBitmap(); |
588 if (state->shouldDraw()) { | 593 if (state->shouldDraw()) { |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 status = kReadAtom_Status; | 853 status = kReadAtom_Status; |
849 break; | 854 break; |
850 } | 855 } |
851 } | 856 } |
852 | 857 |
853 if (bytesRead) { | 858 if (bytesRead) { |
854 *bytesRead = reader.offset(); | 859 *bytesRead = reader.offset(); |
855 } | 860 } |
856 return status; | 861 return status; |
857 } | 862 } |
OLD | NEW |