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

Side by Side Diff: ui/ozone/platform/dri/dri_console_buffer.h

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « ui/ozone/platform/dri/dri_buffer.cc ('k') | ui/ozone/platform/dri/dri_console_buffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_CONSOLE_BUFFER_H_
6 #define UI_OZONE_PLATFORM_DRI_DRI_CONSOLE_BUFFER_H_
7
8 #include "base/macros.h"
9 #include "skia/ext/refptr.h"
10 #include "third_party/skia/include/core/SkSurface.h"
11
12 class SkCanvas;
13
14 namespace ui {
15
16 class DriWrapper;
17
18 // Wrapper for the console buffer. This is the buffer that is allocated by
19 // default by the system and is used when no application is controlling the
20 // CRTC. Keeps track of the native properties of the buffer and wraps the pixel
21 // memory into a SkSurface which can be used to draw into using Skia.
22 class DriConsoleBuffer {
23 public:
24 DriConsoleBuffer(DriWrapper* dri, uint32_t framebuffer);
25 ~DriConsoleBuffer();
26
27 SkCanvas* canvas() { return surface_->getCanvas(); }
28
29 // Memory map the backing pixels and wrap them in |surface_|.
30 bool Initialize();
31
32 protected:
33 DriWrapper* dri_; // Not owned.
34
35 // Wrapper around the native pixel memory.
36 skia::RefPtr<SkSurface> surface_;
37
38 // Length of a row of pixels.
39 uint32_t stride_;
40
41 // Buffer handle used by the DRM allocator.
42 uint32_t handle_;
43
44 // Buffer ID used by the DRM modesettings API.
45 uint32_t framebuffer_;
46
47 // Memory map base address.
48 void* mmap_base_;
49
50 // Memory map size.
51 size_t mmap_size_;
52
53 DISALLOW_COPY_AND_ASSIGN(DriConsoleBuffer);
54 };
55
56 } // namespace ui
57
58 #endif // UI_OZONE_PLATFORM_DRI_DRI_CONSOLE_BUFFER_H_
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/dri_buffer.cc ('k') | ui/ozone/platform/dri/dri_console_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698