| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "SkAnnotation.h" | 9 #include "SkAnnotation.h" |
| 10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 return potential; | 146 return potential; |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 return NULL; | 150 return NULL; |
| 151 } | 151 } |
| 152 | 152 |
| 153 /////////////////////////////////////////////////////////////////////////////// | 153 /////////////////////////////////////////////////////////////////////////////// |
| 154 | 154 |
| 155 struct SkFlattenableTraits { | 155 struct SkFlattenableTraits { |
| 156 static void flatten(SkWriteBuffer& buffer, const SkFlattenable& flattenable)
{ | 156 static void Flatten(SkWriteBuffer& buffer, const SkFlattenable& flattenable)
{ |
| 157 buffer.writeFlattenable(&flattenable); | 157 buffer.writeFlattenable(&flattenable); |
| 158 } | 158 } |
| 159 // No need to define unflatten if we never call it. | 159 // No need to define unflatten if we never call it. |
| 160 }; | 160 }; |
| 161 typedef SkFlatDictionary<SkFlattenable, SkFlattenableTraits> FlatDictionary; | 161 typedef SkFlatDictionary<SkFlattenable, SkFlattenableTraits> FlatDictionary; |
| 162 | 162 |
| 163 /////////////////////////////////////////////////////////////////////////////// | 163 /////////////////////////////////////////////////////////////////////////////// |
| 164 | 164 |
| 165 /** | 165 /** |
| 166 * If SkBitmaps are to be flattened to send to the reader, this class is | 166 * If SkBitmaps are to be flattened to send to the reader, this class is |
| (...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 return fCanvas->shuttleBitmap(bitmap, slot); | 1230 return fCanvas->shuttleBitmap(bitmap, slot); |
| 1231 } | 1231 } |
| 1232 | 1232 |
| 1233 void BitmapShuttle::removeCanvas() { | 1233 void BitmapShuttle::removeCanvas() { |
| 1234 if (NULL == fCanvas) { | 1234 if (NULL == fCanvas) { |
| 1235 return; | 1235 return; |
| 1236 } | 1236 } |
| 1237 fCanvas->unref(); | 1237 fCanvas->unref(); |
| 1238 fCanvas = NULL; | 1238 fCanvas = NULL; |
| 1239 } | 1239 } |
| OLD | NEW |