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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
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 int width() const SK_OVERRIDE { return fSize.width(); } | 61 virtual int width() const SK_OVERRIDE { return fSize.width(); } |
62 virtual int height() const SK_OVERRIDE { return fSize.height(); } | 62 virtual int height() const SK_OVERRIDE { return fSize.height(); } |
63 virtual bool isOpaque() const SK_OVERRIDE { return false; } | 63 virtual bool isOpaque() const SK_OVERRIDE { return false; } |
| 64 #ifdef SK_SUPPORT_LEGACY_DEVICE_CONFIG |
64 virtual SkBitmap::Config config() const SK_OVERRIDE { | 65 virtual SkBitmap::Config config() const SK_OVERRIDE { |
65 return SkBitmap::kNo_Config; | 66 return SkBitmap::kNo_Config; |
66 } | 67 } |
| 68 #endif |
67 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE { return NULL; } | 69 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE { return NULL; } |
68 virtual bool filterTextFlags(const SkPaint& paint, TextFlags*) SK_OVERRIDE { | 70 virtual bool filterTextFlags(const SkPaint& paint, TextFlags*) SK_OVERRIDE { |
69 return false; | 71 return false; |
70 } | 72 } |
71 // TODO: allow this call to return failure, or move to SkBitmapDevice only. | 73 // TODO: allow this call to return failure, or move to SkBitmapDevice only. |
72 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE { | 74 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE { |
73 return fEmptyBitmap; | 75 return fEmptyBitmap; |
74 } | 76 } |
75 virtual void lockPixels() SK_OVERRIDE { nothing_to_do(); } | 77 virtual void lockPixels() SK_OVERRIDE { nothing_to_do(); } |
76 virtual void unlockPixels() SK_OVERRIDE { nothing_to_do(); } | 78 virtual void unlockPixels() SK_OVERRIDE { nothing_to_do(); } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 canvas.clipRect(area, SkRegion::kIntersect_Op, false); | 216 canvas.clipRect(area, SkRegion::kIntersect_Op, false); |
215 canvas.drawPicture(*pict); | 217 canvas.drawPicture(*pict); |
216 | 218 |
217 SkData* data = NULL; | 219 SkData* data = NULL; |
218 int count = array.count(); | 220 int count = array.count(); |
219 if (count > 0) { | 221 if (count > 0) { |
220 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*)
); | 222 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*)
); |
221 } | 223 } |
222 return data; | 224 return data; |
223 } | 225 } |
OLD | NEW |