Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: ui/ozone/platform/dri/dri_buffer.h

Issue 399213005: [Ozone-DRI] Adding ScanoutBuffer interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use RefCounted as base Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/dri/dri.gypi ('k') | ui/ozone/platform/dri/dri_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/dri_buffer.h
diff --git a/ui/ozone/platform/dri/dri_buffer.h b/ui/ozone/platform/dri/dri_buffer.h
index 342f6a6085d42310252e0f4766bb92602c291f11..9b645aee36309b5d96cb21726207cb6218ec8e6b 100644
--- a/ui/ozone/platform/dri/dri_buffer.h
+++ b/ui/ozone/platform/dri/dri_buffer.h
@@ -8,8 +8,7 @@
#include "base/macros.h"
#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkSurface.h"
-
-class SkCanvas;
+#include "ui/ozone/platform/dri/scanout_buffer.h"
namespace ui {
@@ -18,21 +17,24 @@ class DriWrapper;
// Wrapper for a DRM allocated buffer. Keeps track of the native properties of
// the buffer and wraps the pixel memory into a SkSurface which can be used to
// draw into using Skia.
-class DriBuffer {
+class DriBuffer : public ScanoutBuffer {
public:
DriBuffer(DriWrapper* dri);
- ~DriBuffer();
-
- uint32_t stride() const { return stride_; }
- uint32_t handle() const { return handle_; }
- uint32_t framebuffer() const { return framebuffer_; }
- SkCanvas* canvas() { return surface_->getCanvas(); }
// Allocates the backing pixels and wraps them in |surface_|. |info| is used
// to describe the buffer characteristics (size, color format).
bool Initialize(const SkImageInfo& info);
- private:
+ SkCanvas* GetCanvas() const;
+
+ // ScanoutBuffer:
+ virtual uint32_t GetFramebufferId() const OVERRIDE;
+ virtual uint32_t GetHandle() const OVERRIDE;
+ virtual gfx::Size GetSize() const OVERRIDE;
+
+ protected:
+ virtual ~DriBuffer();
+
DriWrapper* dri_; // Not owned.
// Wrapper around the native pixel memory.
@@ -51,6 +53,20 @@ class DriBuffer {
DISALLOW_COPY_AND_ASSIGN(DriBuffer);
};
+class DriBufferGenerator : public ScanoutBufferGenerator {
+ public:
+ DriBufferGenerator(DriWrapper* dri);
+ virtual ~DriBufferGenerator();
+
+ // ScanoutBufferGenerator:
+ virtual scoped_refptr<ScanoutBuffer> Create(const gfx::Size& size) OVERRIDE;
+
+ private:
+ DriWrapper* dri_; // Not owned.
+
+ DISALLOW_COPY_AND_ASSIGN(DriBufferGenerator);
+};
+
} // namespace ui
#endif // UI_OZONE_PLATFORM_DRI_DRI_BUFFER_H_
« no previous file with comments | « ui/ozone/platform/dri/dri.gypi ('k') | ui/ozone/platform/dri/dri_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698