| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 GatherPixelRefDevice(int width, int height, PixelRefSet* prset) { | 55 GatherPixelRefDevice(int width, int height, PixelRefSet* prset) { |
| 56 fSize.set(width, height); | 56 fSize.set(width, height); |
| 57 fEmptyBitmap.setInfo(SkImageInfo::MakeUnknown(width, height)); | 57 fEmptyBitmap.setInfo(SkImageInfo::MakeUnknown(width, height)); |
| 58 fPRSet = prset; | 58 fPRSet = prset; |
| 59 } | 59 } |
| 60 | 60 |
| 61 virtual SkImageInfo imageInfo() const SK_OVERRIDE { | 61 virtual SkImageInfo imageInfo() const SK_OVERRIDE { |
| 62 return SkImageInfo::MakeUnknown(fSize.width(), fSize.height()); | 62 return SkImageInfo::MakeUnknown(fSize.width(), fSize.height()); |
| 63 } | 63 } |
| 64 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE { return NULL; } | 64 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE { return NULL; } |
| 65 virtual bool filterTextFlags(const SkPaint& paint, TextFlags*) SK_OVERRIDE { | |
| 66 return false; | |
| 67 } | |
| 68 // TODO: allow this call to return failure, or move to SkBitmapDevice only. | 65 // TODO: allow this call to return failure, or move to SkBitmapDevice only. |
| 69 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE { | 66 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE { |
| 70 return fEmptyBitmap; | 67 return fEmptyBitmap; |
| 71 } | 68 } |
| 72 virtual void lockPixels() SK_OVERRIDE { nothing_to_do(); } | 69 virtual void lockPixels() SK_OVERRIDE { nothing_to_do(); } |
| 73 virtual void unlockPixels() SK_OVERRIDE { nothing_to_do(); } | 70 virtual void unlockPixels() SK_OVERRIDE { nothing_to_do(); } |
| 74 virtual bool allowImageFilter(const SkImageFilter*) SK_OVERRIDE { return fal
se; } | 71 virtual bool allowImageFilter(const SkImageFilter*) SK_OVERRIDE { return fal
se; } |
| 75 virtual bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE { return
false; } | 72 virtual bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE { return
false; } |
| 76 virtual bool filterImage(const SkImageFilter*, const SkBitmap&, const SkImag
eFilter::Context&, | 73 virtual bool filterImage(const SkImageFilter*, const SkBitmap&, const SkImag
eFilter::Context&, |
| 77 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE { | 74 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 canvas.clipRect(area, SkRegion::kIntersect_Op, false); | 208 canvas.clipRect(area, SkRegion::kIntersect_Op, false); |
| 212 canvas.drawPicture(pict); | 209 canvas.drawPicture(pict); |
| 213 | 210 |
| 214 SkData* data = NULL; | 211 SkData* data = NULL; |
| 215 int count = array.count(); | 212 int count = array.count(); |
| 216 if (count > 0) { | 213 if (count > 0) { |
| 217 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*)
); | 214 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*)
); |
| 218 } | 215 } |
| 219 return data; | 216 return data; |
| 220 } | 217 } |
| OLD | NEW |