| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "skia/public/interfaces/bitmap_skbitmap_struct_traits.h" | 5 #include "skia/public/interfaces/bitmap_skbitmap_struct_traits.h" |
| 6 | 6 |
| 7 namespace mojo { | 7 namespace mojo { |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 | 10 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 return *(b.data + i); | 131 return *(b.data + i); |
| 132 } | 132 } |
| 133 | 133 |
| 134 // static | 134 // static |
| 135 const uint8_t& ArrayTraits<BitmapBuffer>::GetAt(const BitmapBuffer& b, | 135 const uint8_t& ArrayTraits<BitmapBuffer>::GetAt(const BitmapBuffer& b, |
| 136 size_t i) { | 136 size_t i) { |
| 137 return *(b.data + i); | 137 return *(b.data + i); |
| 138 } | 138 } |
| 139 | 139 |
| 140 // static | 140 // static |
| 141 void ArrayTraits<BitmapBuffer>::Resize(BitmapBuffer& b, size_t size) { | 141 bool ArrayTraits<BitmapBuffer>::Resize(BitmapBuffer& b, size_t size) { |
| 142 CHECK_EQ(size, b.size); | 142 return b.size == size; |
| 143 } | 143 } |
| 144 | 144 |
| 145 // static | 145 // static |
| 146 bool StructTraits<skia::mojom::Bitmap, SkBitmap>::IsNull(const SkBitmap& b) { | 146 bool StructTraits<skia::mojom::Bitmap, SkBitmap>::IsNull(const SkBitmap& b) { |
| 147 return b.isNull(); | 147 return b.isNull(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 // static | 150 // static |
| 151 void StructTraits<skia::mojom::Bitmap, SkBitmap>::SetToNull(SkBitmap* b) { | 151 void StructTraits<skia::mojom::Bitmap, SkBitmap>::SetToNull(SkBitmap* b) { |
| 152 b->reset(); | 152 b->reset(); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 } | 233 } |
| 234 | 234 |
| 235 // static | 235 // static |
| 236 void StructTraits<skia::mojom::Bitmap, SkBitmap>::TearDownContext( | 236 void StructTraits<skia::mojom::Bitmap, SkBitmap>::TearDownContext( |
| 237 const SkBitmap& b, | 237 const SkBitmap& b, |
| 238 void* context) { | 238 void* context) { |
| 239 b.unlockPixels(); | 239 b.unlockPixels(); |
| 240 } | 240 } |
| 241 | 241 |
| 242 } // namespace mojo | 242 } // namespace mojo |
| OLD | NEW |