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