| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ozone/platform/dri/dri_buffer.h" | 5 #include "ui/ozone/platform/dri/dri_buffer.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 13 matching lines...) Expand all Loading... |
| 24 switch (type) { | 24 switch (type) { |
| 25 case kUnknown_SkColorType: | 25 case kUnknown_SkColorType: |
| 26 case kAlpha_8_SkColorType: | 26 case kAlpha_8_SkColorType: |
| 27 return 0; | 27 return 0; |
| 28 case kIndex_8_SkColorType: | 28 case kIndex_8_SkColorType: |
| 29 return 8; | 29 return 8; |
| 30 case kRGB_565_SkColorType: | 30 case kRGB_565_SkColorType: |
| 31 return 16; | 31 return 16; |
| 32 case kARGB_4444_SkColorType: | 32 case kARGB_4444_SkColorType: |
| 33 return 12; | 33 return 12; |
| 34 case kPMColor_SkColorType: | 34 case kN32_SkColorType: |
| 35 return 24; | 35 return 24; |
| 36 default: | 36 default: |
| 37 NOTREACHED(); | 37 NOTREACHED(); |
| 38 return 0; | 38 return 0; |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 | 41 |
| 42 void DestroyDumbBuffer(int fd, uint32_t handle) { | 42 void DestroyDumbBuffer(int fd, uint32_t handle) { |
| 43 struct drm_mode_destroy_dumb destroy_request; | 43 struct drm_mode_destroy_dumb destroy_request; |
| 44 destroy_request.handle = handle; | 44 destroy_request.handle = handle; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 surface_ = skia::AdoptRef(SkSurface::NewRasterDirect(info, pixels, stride_)); | 122 surface_ = skia::AdoptRef(SkSurface::NewRasterDirect(info, pixels, stride_)); |
| 123 if (!surface_) { | 123 if (!surface_) { |
| 124 DLOG(ERROR) << "Cannot install Skia pixels for drm buffer"; | 124 DLOG(ERROR) << "Cannot install Skia pixels for drm buffer"; |
| 125 return false; | 125 return false; |
| 126 } | 126 } |
| 127 | 127 |
| 128 return true; | 128 return true; |
| 129 } | 129 } |
| 130 | 130 |
| 131 } // namespace ui | 131 } // namespace ui |
| OLD | NEW |