OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkImagePriv.h" | 10 #include "SkImagePriv.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 do { | 26 do { |
27 id = sk_atomic_inc(&gUniqueID) + 1; | 27 id = sk_atomic_inc(&gUniqueID) + 1; |
28 } while (0 == id); | 28 } while (0 == id); |
29 return id; | 29 return id; |
30 } | 30 } |
31 | 31 |
32 void SkImage::draw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* pain
t) const { | 32 void SkImage::draw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* pain
t) const { |
33 as_IB(this)->onDraw(canvas, x, y, paint); | 33 as_IB(this)->onDraw(canvas, x, y, paint); |
34 } | 34 } |
35 | 35 |
36 void SkImage::draw(SkCanvas* canvas, const SkRect* src, const SkRect& dst, | 36 void SkImage::drawRect(SkCanvas* canvas, const SkRect* src, const SkRect& dst, |
37 const SkPaint* paint) const { | 37 const SkPaint* paint) const { |
38 as_IB(this)->onDrawRectToRect(canvas, src, dst, paint); | 38 as_IB(this)->onDrawRect(canvas, src, dst, paint); |
39 } | 39 } |
40 | 40 |
41 const void* SkImage::peekPixels(SkImageInfo* info, size_t* rowBytes) const { | 41 const void* SkImage::peekPixels(SkImageInfo* info, size_t* rowBytes) const { |
42 SkImageInfo infoStorage; | 42 SkImageInfo infoStorage; |
43 size_t rowBytesStorage; | 43 size_t rowBytesStorage; |
44 if (NULL == info) { | 44 if (NULL == info) { |
45 info = &infoStorage; | 45 info = &infoStorage; |
46 } | 46 } |
47 if (NULL == rowBytes) { | 47 if (NULL == rowBytes) { |
48 rowBytes = &rowBytesStorage; | 48 rowBytes = &rowBytesStorage; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 SkCanvas canvas(*bitmap); | 132 SkCanvas canvas(*bitmap); |
133 | 133 |
134 SkPaint paint; | 134 SkPaint paint; |
135 paint.setXfermodeMode(SkXfermode::kClear_Mode); | 135 paint.setXfermodeMode(SkXfermode::kClear_Mode); |
136 canvas.drawRect(dstR, paint); | 136 canvas.drawRect(dstR, paint); |
137 | 137 |
138 canvas.drawImageRect(this, &srcR, dstR); | 138 canvas.drawImageRect(this, &srcR, dstR); |
139 return true; | 139 return true; |
140 } | 140 } |
OLD | NEW |