| 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 #ifndef UI_OZONE_PLATFORM_DRI_DRI_BUFFER_H_ |   5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_BUFFER_H_ | 
|   6 #define UI_OZONE_PLATFORM_DRI_DRI_BUFFER_H_ |   6 #define UI_OZONE_PLATFORM_DRI_DRI_BUFFER_H_ | 
|   7  |   7  | 
|   8 #include "base/macros.h" |   8 #include "base/macros.h" | 
|   9 #include "skia/ext/refptr.h" |   9 #include "skia/ext/refptr.h" | 
|  10 #include "third_party/skia/include/core/SkSurface.h" |  10 #include "third_party/skia/include/core/SkSurface.h" | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
|  21  public: |  21  public: | 
|  22   DriBuffer(DriWrapper* dri); |  22   DriBuffer(DriWrapper* dri); | 
|  23  |  23  | 
|  24   // Allocates the backing pixels and wraps them in |surface_|. |info| is used |  24   // Allocates the backing pixels and wraps them in |surface_|. |info| is used | 
|  25   // to describe the buffer characteristics (size, color format). |  25   // to describe the buffer characteristics (size, color format). | 
|  26   bool Initialize(const SkImageInfo& info); |  26   bool Initialize(const SkImageInfo& info); | 
|  27  |  27  | 
|  28   SkCanvas* GetCanvas() const; |  28   SkCanvas* GetCanvas() const; | 
|  29  |  29  | 
|  30   // ScanoutBuffer: |  30   // ScanoutBuffer: | 
|  31   virtual uint32_t GetFramebufferId() const OVERRIDE; |  31   virtual uint32_t GetFramebufferId() const override; | 
|  32   virtual uint32_t GetHandle() const OVERRIDE; |  32   virtual uint32_t GetHandle() const override; | 
|  33   virtual gfx::Size GetSize() const OVERRIDE; |  33   virtual gfx::Size GetSize() const override; | 
|  34  |  34  | 
|  35  protected: |  35  protected: | 
|  36   virtual ~DriBuffer(); |  36   virtual ~DriBuffer(); | 
|  37  |  37  | 
|  38   DriWrapper* dri_;  // Not owned. |  38   DriWrapper* dri_;  // Not owned. | 
|  39  |  39  | 
|  40   // Wrapper around the native pixel memory. |  40   // Wrapper around the native pixel memory. | 
|  41   skia::RefPtr<SkSurface> surface_; |  41   skia::RefPtr<SkSurface> surface_; | 
|  42  |  42  | 
|  43   // Length of a row of pixels. |  43   // Length of a row of pixels. | 
|  44   uint32_t stride_; |  44   uint32_t stride_; | 
|  45  |  45  | 
|  46   // Buffer handle used by the DRM allocator. |  46   // Buffer handle used by the DRM allocator. | 
|  47   uint32_t handle_; |  47   uint32_t handle_; | 
|  48  |  48  | 
|  49   // Buffer ID used by the DRM modesettings API. This is set when the buffer is |  49   // Buffer ID used by the DRM modesettings API. This is set when the buffer is | 
|  50   // registered with the CRTC. |  50   // registered with the CRTC. | 
|  51   uint32_t framebuffer_; |  51   uint32_t framebuffer_; | 
|  52  |  52  | 
|  53   DISALLOW_COPY_AND_ASSIGN(DriBuffer); |  53   DISALLOW_COPY_AND_ASSIGN(DriBuffer); | 
|  54 }; |  54 }; | 
|  55  |  55  | 
|  56 class DriBufferGenerator : public ScanoutBufferGenerator { |  56 class DriBufferGenerator : public ScanoutBufferGenerator { | 
|  57  public: |  57  public: | 
|  58   DriBufferGenerator(DriWrapper* dri); |  58   DriBufferGenerator(DriWrapper* dri); | 
|  59   virtual ~DriBufferGenerator(); |  59   virtual ~DriBufferGenerator(); | 
|  60  |  60  | 
|  61   // ScanoutBufferGenerator: |  61   // ScanoutBufferGenerator: | 
|  62   virtual scoped_refptr<ScanoutBuffer> Create(const gfx::Size& size) OVERRIDE; |  62   virtual scoped_refptr<ScanoutBuffer> Create(const gfx::Size& size) override; | 
|  63  |  63  | 
|  64  private: |  64  private: | 
|  65   DriWrapper* dri_;  // Not owned. |  65   DriWrapper* dri_;  // Not owned. | 
|  66  |  66  | 
|  67   DISALLOW_COPY_AND_ASSIGN(DriBufferGenerator); |  67   DISALLOW_COPY_AND_ASSIGN(DriBufferGenerator); | 
|  68 }; |  68 }; | 
|  69  |  69  | 
|  70 }  // namespace ui |  70 }  // namespace ui | 
|  71  |  71  | 
|  72 #endif  // UI_OZONE_PLATFORM_DRI_DRI_BUFFER_H_ |  72 #endif  // UI_OZONE_PLATFORM_DRI_DRI_BUFFER_H_ | 
| OLD | NEW |