| 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 "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkData.h" | 10 #include "SkData.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 this->addBitmapFromPaint(paint); | 105 this->addBitmapFromPaint(paint); |
| 106 } | 106 } |
| 107 virtual void drawPath(const SkDraw&, const SkPath& path, | 107 virtual void drawPath(const SkDraw&, const SkPath& path, |
| 108 const SkPaint& paint, const SkMatrix* prePathMatrix, | 108 const SkPaint& paint, const SkMatrix* prePathMatrix, |
| 109 bool pathIsMutable) SK_OVERRIDE { | 109 bool pathIsMutable) SK_OVERRIDE { |
| 110 this->addBitmapFromPaint(paint); | 110 this->addBitmapFromPaint(paint); |
| 111 } | 111 } |
| 112 virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap, | 112 virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap, |
| 113 const SkMatrix&, const SkPaint& paint) SK_OVERRIDE { | 113 const SkMatrix&, const SkPaint& paint) SK_OVERRIDE { |
| 114 this->addBitmap(bitmap); | 114 this->addBitmap(bitmap); |
| 115 if (SkBitmap::kA8_Config == bitmap.config()) { | 115 if (kAlpha_8_SkColorType == bitmap.colorType()) { |
| 116 this->addBitmapFromPaint(paint); | 116 this->addBitmapFromPaint(paint); |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 virtual void drawBitmapRect(const SkDraw&, const SkBitmap& bitmap, | 119 virtual void drawBitmapRect(const SkDraw&, const SkBitmap& bitmap, |
| 120 const SkRect* srcOrNull, const SkRect& dst, | 120 const SkRect* srcOrNull, const SkRect& dst, |
| 121 const SkPaint& paint, | 121 const SkPaint& paint, |
| 122 SkCanvas::DrawBitmapRectFlags flags) SK_OVERRIDE
{ | 122 SkCanvas::DrawBitmapRectFlags flags) SK_OVERRIDE
{ |
| 123 this->addBitmap(bitmap); | 123 this->addBitmap(bitmap); |
| 124 if (SkBitmap::kA8_Config == bitmap.config()) { | 124 if (kAlpha_8_SkColorType == bitmap.colorType()) { |
| 125 this->addBitmapFromPaint(paint); | 125 this->addBitmapFromPaint(paint); |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, | 128 virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, |
| 129 int x, int y, const SkPaint& paint) SK_OVERRIDE { | 129 int x, int y, const SkPaint& paint) SK_OVERRIDE { |
| 130 this->addBitmap(bitmap); | 130 this->addBitmap(bitmap); |
| 131 } | 131 } |
| 132 virtual void drawText(const SkDraw&, const void* text, size_t len, | 132 virtual void drawText(const SkDraw&, const void* text, size_t len, |
| 133 SkScalar x, SkScalar y, | 133 SkScalar x, SkScalar y, |
| 134 const SkPaint& paint) SK_OVERRIDE { | 134 const SkPaint& paint) SK_OVERRIDE { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 canvas.clipRect(area, SkRegion::kIntersect_Op, false); | 214 canvas.clipRect(area, SkRegion::kIntersect_Op, false); |
| 215 canvas.drawPicture(*pict); | 215 canvas.drawPicture(*pict); |
| 216 | 216 |
| 217 SkData* data = NULL; | 217 SkData* data = NULL; |
| 218 int count = array.count(); | 218 int count = array.count(); |
| 219 if (count > 0) { | 219 if (count > 0) { |
| 220 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*)
); | 220 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*)
); |
| 221 } | 221 } |
| 222 return data; | 222 return data; |
| 223 } | 223 } |
| OLD | NEW |