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::kBlee d_DrawBitmapRectFlag); | |
scroggo
2013/08/13 21:05:46
over 100 chars.
robertphillips
2013/08/14 15:37:41
Done.
| |
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, hasPaint ? &state->pain t() : NULL, dbmrFlags); |
scroggo
2013/08/13 21:05:46
over 100 chars.
robertphillips
2013/08/14 15:37:41
Done.
| |
579 } | 583 } |
580 } | 584 } |
581 | 585 |
582 static void drawSprite_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, | 586 static void drawSprite_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32, |
583 SkGPipeState* state) { | 587 SkGPipeState* state) { |
584 BitmapHolder holder(reader, op32, state); | 588 BitmapHolder holder(reader, op32, state); |
585 bool hasPaint = SkToBool(DrawOp_unpackFlags(op32) & kDrawBitmap_HasPaint_Dra wOpFlag); | 589 bool hasPaint = SkToBool(DrawOp_unpackFlags(op32) & kDrawBitmap_HasPaint_Dra wOpFlag); |
586 const SkIPoint* point = skip<SkIPoint>(reader); | 590 const SkIPoint* point = skip<SkIPoint>(reader); |
587 const SkBitmap* bitmap = holder.getBitmap(); | 591 const SkBitmap* bitmap = holder.getBitmap(); |
588 if (state->shouldDraw()) { | 592 if (state->shouldDraw()) { |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
848 status = kReadAtom_Status; | 852 status = kReadAtom_Status; |
849 break; | 853 break; |
850 } | 854 } |
851 } | 855 } |
852 | 856 |
853 if (bytesRead) { | 857 if (bytesRead) { |
854 *bytesRead = reader.offset(); | 858 *bytesRead = reader.offset(); |
855 } | 859 } |
856 return status; | 860 return status; |
857 } | 861 } |
OLD | NEW |