Chromium Code Reviews| Index: ui/gfx/ozone/impl/drm_skbitmap_ozone.h |
| diff --git a/ui/gfx/ozone/impl/drm_skbitmap_ozone.h b/ui/gfx/ozone/impl/drm_skbitmap_ozone.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1635c89890db83f0782865db28c730da951bc807 |
| --- /dev/null |
| +++ b/ui/gfx/ozone/impl/drm_skbitmap_ozone.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_GFX_OZONE_IMPL_DRM_SKBITMAP_OZONE_H_ |
| +#define UI_GFX_OZONE_IMPL_DRM_SKBITMAP_OZONE_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "third_party/skia/include/core/SkBitmap.h" |
| + |
| +namespace gfx { |
| + |
| +// Extend the SkBitmap interface to keep track additional parameters used by the |
|
rjkroege
2013/10/10 21:26:53
keep track of
|
| +// DRM stack when allocating buffers. |
| +class DrmSkBitmapOzone : public SkBitmap { |
| + public: |
| + DrmSkBitmapOzone(int fd); |
| + virtual ~DrmSkBitmapOzone(); |
| + |
| + // Allocates the backing pixels using DRM. |
| + // Return true on success, false otherwise. |
| + virtual bool Initialize(); |
| + |
| + uint32_t get_handle() const { return handle_; }; |
| + |
| + uint32_t get_framebuffer() const { return framebuffer_; }; |
| + |
| + int get_fd() const { return fd_; }; |
| + |
| + // Return the color depth of a pixel in this buffer. |
| + uint8_t GetColorDepth() const; |
| + |
| + private: |
| + friend class DrmAllocator; |
| + |
| + void set_handle(uint32_t handle) { handle_ = handle; }; |
| + void set_framebuffer(uint32_t framebuffer) { framebuffer_ = framebuffer; }; |
| + |
| + // File descriptor used by the DRM allocator to request buffers from the DRM |
| + // stack. |
| + int fd_; |
| + |
| + // Buffer handle used by the DRM allocator. |
| + uint32_t handle_; |
| + |
| + // Buffer ID used by the DRM modesettings API. This is set when the buffer is |
| + // registered with the CRTC. |
| + uint32_t framebuffer_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DrmSkBitmapOzone); |
| +}; |
| + |
| +} // namespace gfx |
| + |
| +#endif // UI_GFX_OZONE_IMPL_DRM_SKBITMAP_OZONE_H_ |