OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/gfx/ozone/dri/dri_skbitmap.h" | 5 #include "ui/gfx/ozone/dri/dri_skbitmap.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <sys/mman.h> | 8 #include <sys/mman.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #include <xf86drm.h> | 10 #include <xf86drm.h> |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 182 } |
183 | 183 |
184 bool DriSkBitmap::Initialize() { | 184 bool DriSkBitmap::Initialize() { |
185 DriAllocator drm_allocator; | 185 DriAllocator drm_allocator; |
186 return allocPixels(&drm_allocator, NULL); | 186 return allocPixels(&drm_allocator, NULL); |
187 } | 187 } |
188 | 188 |
189 uint8_t DriSkBitmap::GetColorDepth() const { | 189 uint8_t DriSkBitmap::GetColorDepth() const { |
190 switch (config()) { | 190 switch (config()) { |
191 case SkBitmap::kNo_Config: | 191 case SkBitmap::kNo_Config: |
192 case SkBitmap::kA1_Config: | |
193 case SkBitmap::kA8_Config: | 192 case SkBitmap::kA8_Config: |
194 return 0; | 193 return 0; |
195 case SkBitmap::kIndex8_Config: | 194 case SkBitmap::kIndex8_Config: |
196 return 8; | 195 return 8; |
197 case SkBitmap::kRGB_565_Config: | 196 case SkBitmap::kRGB_565_Config: |
198 return 16; | 197 return 16; |
199 case SkBitmap::kARGB_4444_Config: | 198 case SkBitmap::kARGB_4444_Config: |
200 return 12; | 199 return 12; |
201 case SkBitmap::kARGB_8888_Config: | 200 case SkBitmap::kARGB_8888_Config: |
202 return 24; | 201 return 24; |
203 default: | 202 default: |
204 NOTREACHED(); | 203 NOTREACHED(); |
205 return 0; | 204 return 0; |
206 } | 205 } |
207 } | 206 } |
208 | 207 |
209 } // namespace gfx | 208 } // namespace gfx |
OLD | NEW |