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 "SkPictureUtils.h" | 8 #include "SkPictureUtils.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkData.h" | 10 #include "SkData.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // SkDebugf("--- already have %x %d\n", pr, genID); | 30 // SkDebugf("--- already have %x %d\n", pr, genID); |
31 } | 31 } |
32 } | 32 } |
33 | 33 |
34 private: | 34 private: |
35 SkTDArray<SkPixelRef*>* fArray; | 35 SkTDArray<SkPixelRef*>* fArray; |
36 SkTDArray<uint32_t> fGenID; | 36 SkTDArray<uint32_t> fGenID; |
37 }; | 37 }; |
38 | 38 |
39 static void not_supported() { | 39 static void not_supported() { |
40 SkASSERT(!"this method should never be called"); | 40 SkDEBUGFAIL("this method should never be called"); |
41 } | 41 } |
42 | 42 |
43 static void nothing_to_do() {} | 43 static void nothing_to_do() {} |
44 | 44 |
45 /** | 45 /** |
46 * This device will route all bitmaps (primitives and in shaders) to its PRSet. | 46 * This device will route all bitmaps (primitives and in shaders) to its PRSet. |
47 * It should never actually draw anything, so there need not be any pixels | 47 * It should never actually draw anything, so there need not be any pixels |
48 * behind its device-bitmap. | 48 * behind its device-bitmap. |
49 */ | 49 */ |
50 class GatherPixelRefDevice : public SkDevice { | 50 class GatherPixelRefDevice : public SkDevice { |
(...skipping 165 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 |