diff options
author | kalyan.kondapally <kalyan.kondapally@intel.com> | 2015-10-23 11:47:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-23 18:49:09 +0000 |
commit | 85499ff7a88fa10f42e2c3e8e3f00a02deb7788b (patch) | |
tree | 35257bd301d03bfcd6875b748f74b31cf5907c9b /ui | |
parent | 0639980817fd92e1d02051cb46c99b53db5c696e (diff) | |
download | chromium_src-85499ff7a88fa10f42e2c3e8e3f00a02deb7788b.zip chromium_src-85499ff7a88fa10f42e2c3e8e3f00a02deb7788b.tar.gz chromium_src-85499ff7a88fa10f42e2c3e8e3f00a02deb7788b.tar.bz2 |
Take alpha into account in DrmBuffer
DrmBuffer is used only for cursor and not anymore as modeset buffers.
We ignored alpha in GetColorDepth and GetFourCCCodeForSkColorType, which
shouldn't be needed now.
BUG=
Review URL: https://codereview.chromium.org/1409113007
Cr-Commit-Position: refs/heads/master@{#355845}
Diffstat (limited to 'ui')
-rw-r--r-- | ui/ozone/platform/drm/gpu/drm_buffer.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/ui/ozone/platform/drm/gpu/drm_buffer.cc b/ui/ozone/platform/drm/gpu/drm_buffer.cc index 2eb3861..4a2db96 100644 --- a/ui/ozone/platform/drm/gpu/drm_buffer.cc +++ b/ui/ozone/platform/drm/gpu/drm_buffer.cc @@ -13,8 +13,6 @@ namespace ui { namespace { -// Modesetting cannot happen from a buffer with transparencies. Return the size -// of a pixel without alpha. uint8_t GetColorDepth(SkColorType type) { switch (type) { case kUnknown_SkColorType: @@ -25,16 +23,15 @@ uint8_t GetColorDepth(SkColorType type) { case kRGB_565_SkColorType: return 16; case kARGB_4444_SkColorType: - return 12; + return 16; case kN32_SkColorType: - return 24; + return 32; default: NOTREACHED(); return 0; } } -// We always ignore Alpha. uint32_t GetFourCCCodeForSkColorType(SkColorType type) { switch (type) { case kUnknown_SkColorType: @@ -45,9 +42,9 @@ uint32_t GetFourCCCodeForSkColorType(SkColorType type) { case kRGB_565_SkColorType: return DRM_FORMAT_RGB565; case kARGB_4444_SkColorType: - return DRM_FORMAT_XRGB4444; + return DRM_FORMAT_ARGB4444; case kN32_SkColorType: - return DRM_FORMAT_XRGB8888; + return DRM_FORMAT_ARGB8888; default: NOTREACHED(); return 0; |