| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } | 150 } |
| 151 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | 151 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, |
| 152 const SkPaint&) SK_OVERRIDE { | 152 const SkPaint&) SK_OVERRIDE { |
| 153 nothing_to_do(); | 153 nothing_to_do(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 protected: | 156 protected: |
| 157 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) SK_OVERRI
DE { | 157 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) SK_OVERRI
DE { |
| 158 not_supported(); | 158 not_supported(); |
| 159 } | 159 } |
| 160 virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info, Usage usage) S
K_OVERRIDE { | 160 virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo& cinfo) SK_O
VERRIDE { |
| 161 // we expect to only get called via savelayer, in which case it is fine. | 161 // we expect to only get called via savelayer, in which case it is fine. |
| 162 SkASSERT(kSaveLayer_Usage == usage); | 162 SkASSERT(kSaveLayer_Usage == cinfo.fUsage); |
| 163 return SkNEW_ARGS(GatherPixelRefDevice, (info.width(), info.height(), fP
RSet)); | 163 return SkNEW_ARGS(GatherPixelRefDevice, (cinfo.fInfo.width(), cinfo.fInf
o.height(), fPRSet)); |
| 164 } | 164 } |
| 165 virtual void flush() SK_OVERRIDE {} | 165 virtual void flush() SK_OVERRIDE {} |
| 166 | 166 |
| 167 private: | 167 private: |
| 168 PixelRefSet* fPRSet; | 168 PixelRefSet* fPRSet; |
| 169 SkBitmap fEmptyBitmap; // legacy -- need to remove the need for this guy | 169 SkBitmap fEmptyBitmap; // legacy -- need to remove the need for this guy |
| 170 SkISize fSize; | 170 SkISize fSize; |
| 171 | 171 |
| 172 void addBitmap(const SkBitmap& bm) { | 172 void addBitmap(const SkBitmap& bm) { |
| 173 fPRSet->add(bm.pixelRef()); | 173 fPRSet->add(bm.pixelRef()); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 canvas.clipRect(area, SkRegion::kIntersect_Op, false); | 211 canvas.clipRect(area, SkRegion::kIntersect_Op, false); |
| 212 canvas.drawPicture(pict); | 212 canvas.drawPicture(pict); |
| 213 | 213 |
| 214 SkData* data = NULL; | 214 SkData* data = NULL; |
| 215 int count = array.count(); | 215 int count = array.count(); |
| 216 if (count > 0) { | 216 if (count > 0) { |
| 217 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*)
); | 217 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*)
); |
| 218 } | 218 } |
| 219 return data; | 219 return data; |
| 220 } | 220 } |
| OLD | NEW |