| 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
; | 575 SkCanvas::DrawBitmapRectFlags dbmrFlags = SkCanvas::kNone_DrawBitmapRectFlag
; |
| 576 if (flags & kDrawBitmap_Bleed_DrawOpFlag) { | 576 if (flags & kDrawBitmap_Bleed_DrawOpFlag) { |
| 577 dbmrFlags = (SkCanvas::DrawBitmapRectFlags)(dbmrFlags|SkCanvas::kBleed_D
rawBitmapRectFlag); | 577 dbmrFlags = (SkCanvas::DrawBitmapRectFlags)(dbmrFlags|SkCanvas::kBleed_D
rawBitmapRectFlag); |
| 578 } | 578 } |
| 579 const SkRect* dst = skip<SkRect>(reader); | 579 const SkRect* dst = skip<SkRect>(reader); |
| 580 const SkBitmap* bitmap = holder.getBitmap(); | 580 const SkBitmap* bitmap = holder.getBitmap(); |
| 581 if (state->shouldDraw()) { | 581 if (state->shouldDraw()) { |
| 582 canvas->drawBitmapRectToRect(*bitmap, src, *dst, | 582 canvas->drawBitmapRectToRect(*bitmap, src, *dst, |
| 583 hasPaint ? &state->paint() : NULL, dbmrFlag
s); | 583 hasPaint ? &state->paint() : NULL, dbmrFlag
s); |
| 584 } | 584 } |
| 585 } | 585 } |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 status = kReadAtom_Status; | 853 status = kReadAtom_Status; |
| 854 break; | 854 break; |
| 855 } | 855 } |
| 856 } | 856 } |
| 857 | 857 |
| 858 if (bytesRead) { | 858 if (bytesRead) { |
| 859 *bytesRead = reader.offset(); | 859 *bytesRead = reader.offset(); |
| 860 } | 860 } |
| 861 return status; | 861 return status; |
| 862 } | 862 } |
| OLD | NEW |