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 #include "SkAnnotation.h" | 9 #include "SkAnnotation.h" |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 const SkPaint&) SK_OVERRIDE; | 238 const SkPaint&) SK_OVERRIDE; |
239 virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE; | 239 virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE; |
240 virtual void drawRect(const SkRect& rect, const SkPaint&) SK_OVERRIDE; | 240 virtual void drawRect(const SkRect& rect, const SkPaint&) SK_OVERRIDE; |
241 virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; | 241 virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; |
242 virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE; | 242 virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE; |
243 virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top, | 243 virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top, |
244 const SkPaint*) SK_OVERRIDE; | 244 const SkPaint*) SK_OVERRIDE; |
245 virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src, | 245 virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src, |
246 const SkRect& dst, const SkPaint* paint, | 246 const SkRect& dst, const SkPaint* paint, |
247 DrawBitmapRectFlags flags) SK_OVERRIDE; | 247 DrawBitmapRectFlags flags) SK_OVERRIDE; |
248 virtual void drawBitmapMatrix(const SkBitmap&, const SkMatrix&, | |
249 const SkPaint*) SK_OVERRIDE; | |
250 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, | 248 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, |
251 const SkRect& dst, const SkPaint* paint = NULL)
SK_OVERRIDE; | 249 const SkRect& dst, const SkPaint* paint = NULL)
SK_OVERRIDE; |
252 virtual void drawSprite(const SkBitmap&, int left, int top, | 250 virtual void drawSprite(const SkBitmap&, int left, int top, |
253 const SkPaint*) SK_OVERRIDE; | 251 const SkPaint*) SK_OVERRIDE; |
254 virtual void drawVertices(VertexMode, int vertexCount, | 252 virtual void drawVertices(VertexMode, int vertexCount, |
255 const SkPoint vertices[], const SkPoint texs[], | 253 const SkPoint vertices[], const SkPoint texs[], |
256 const SkColor colors[], SkXfermode*, | 254 const SkColor colors[], SkXfermode*, |
257 const uint16_t indices[], int indexCount, | 255 const uint16_t indices[], int indexCount, |
258 const SkPaint&) SK_OVERRIDE; | 256 const SkPaint&) SK_OVERRIDE; |
259 virtual void drawData(const void*, size_t) SK_OVERRIDE; | 257 virtual void drawData(const void*, size_t) SK_OVERRIDE; |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 } | 811 } |
814 | 812 |
815 if (this->commonDrawBitmap(bm, kDrawBitmapRectToRect_DrawOp, flags, opBytesN
eeded, paint)) { | 813 if (this->commonDrawBitmap(bm, kDrawBitmapRectToRect_DrawOp, flags, opBytesN
eeded, paint)) { |
816 if (hasSrc) { | 814 if (hasSrc) { |
817 fWriter.writeRect(*src); | 815 fWriter.writeRect(*src); |
818 } | 816 } |
819 fWriter.writeRect(dst); | 817 fWriter.writeRect(dst); |
820 } | 818 } |
821 } | 819 } |
822 | 820 |
823 void SkGPipeCanvas::drawBitmapMatrix(const SkBitmap& bm, const SkMatrix& matrix, | |
824 const SkPaint* paint) { | |
825 NOTIFY_SETUP(this); | |
826 size_t opBytesNeeded = matrix.writeToMemory(NULL); | |
827 | |
828 if (this->commonDrawBitmap(bm, kDrawBitmapMatrix_DrawOp, 0, opBytesNeeded, p
aint)) { | |
829 fWriter.writeMatrix(matrix); | |
830 } | |
831 } | |
832 | |
833 void SkGPipeCanvas::drawBitmapNine(const SkBitmap& bm, const SkIRect& center, | 821 void SkGPipeCanvas::drawBitmapNine(const SkBitmap& bm, const SkIRect& center, |
834 const SkRect& dst, const SkPaint* paint) { | 822 const SkRect& dst, const SkPaint* paint) { |
835 NOTIFY_SETUP(this); | 823 NOTIFY_SETUP(this); |
836 size_t opBytesNeeded = sizeof(int32_t) * 4 + sizeof(SkRect); | 824 size_t opBytesNeeded = sizeof(int32_t) * 4 + sizeof(SkRect); |
837 | 825 |
838 if (this->commonDrawBitmap(bm, kDrawBitmapNine_DrawOp, 0, opBytesNeeded, pai
nt)) { | 826 if (this->commonDrawBitmap(bm, kDrawBitmapNine_DrawOp, 0, opBytesNeeded, pai
nt)) { |
839 fWriter.write32(center.fLeft); | 827 fWriter.write32(center.fLeft); |
840 fWriter.write32(center.fTop); | 828 fWriter.write32(center.fTop); |
841 fWriter.write32(center.fRight); | 829 fWriter.write32(center.fRight); |
842 fWriter.write32(center.fBottom); | 830 fWriter.write32(center.fBottom); |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 return fCanvas->shuttleBitmap(bitmap, slot); | 1367 return fCanvas->shuttleBitmap(bitmap, slot); |
1380 } | 1368 } |
1381 | 1369 |
1382 void BitmapShuttle::removeCanvas() { | 1370 void BitmapShuttle::removeCanvas() { |
1383 if (NULL == fCanvas) { | 1371 if (NULL == fCanvas) { |
1384 return; | 1372 return; |
1385 } | 1373 } |
1386 fCanvas->unref(); | 1374 fCanvas->unref(); |
1387 fCanvas = NULL; | 1375 fCanvas = NULL; |
1388 } | 1376 } |
OLD | NEW |