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

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

Issue 371813004: ozone: gbm: Add overlay support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test build 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/ozone/platform/dri/dri_surface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_SURFACE_H_ 5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_SURFACE_H_
6 #define UI_OZONE_PLATFORM_DRI_DRI_SURFACE_H_ 6 #define UI_OZONE_PLATFORM_DRI_DRI_SURFACE_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ui/gfx/geometry/size.h" 10 #include "ui/gfx/geometry/size.h"
(...skipping 14 matching lines...) Expand all
25 DriSurface(DriWrapper* dri, const gfx::Size& size); 25 DriSurface(DriWrapper* dri, const gfx::Size& size);
26 virtual ~DriSurface(); 26 virtual ~DriSurface();
27 27
28 // Get a Skia canvas for a backbuffer. 28 // Get a Skia canvas for a backbuffer.
29 SkCanvas* GetDrawableForWidget(); 29 SkCanvas* GetDrawableForWidget();
30 30
31 // ScanoutSurface: 31 // ScanoutSurface:
32 virtual bool Initialize() OVERRIDE; 32 virtual bool Initialize() OVERRIDE;
33 virtual uint32_t GetFramebufferId() const OVERRIDE; 33 virtual uint32_t GetFramebufferId() const OVERRIDE;
34 virtual uint32_t GetHandle() const OVERRIDE; 34 virtual uint32_t GetHandle() const OVERRIDE;
35 virtual void PreSwapBuffers() OVERRIDE;
35 virtual void SwapBuffers() OVERRIDE; 36 virtual void SwapBuffers() OVERRIDE;
36 virtual gfx::Size Size() const OVERRIDE; 37 virtual gfx::Size Size() const OVERRIDE;
37 38
38 private: 39 private:
39 DriBuffer* frontbuffer() const { return bitmaps_[front_buffer_].get(); } 40 DriBuffer* frontbuffer() const { return bitmaps_[front_buffer_].get(); }
40 DriBuffer* backbuffer() const { return bitmaps_[front_buffer_ ^ 1].get(); } 41 DriBuffer* backbuffer() const { return bitmaps_[front_buffer_ ^ 1].get(); }
41 42
42 // Used to create the backing buffers. 43 // Used to create the backing buffers.
43 virtual DriBuffer* CreateBuffer(); 44 virtual DriBuffer* CreateBuffer();
44 45
45 // Stores the connection to the graphics card. Pointer not owned by this 46 // Stores the connection to the graphics card. Pointer not owned by this
46 // class. 47 // class.
47 DriWrapper* dri_; 48 DriWrapper* dri_;
48 49
49 // The actual buffers used for painting. 50 // The actual buffers used for painting.
50 scoped_ptr<DriBuffer> bitmaps_[2]; 51 scoped_ptr<DriBuffer> bitmaps_[2];
51 52
52 // Keeps track of which bitmap is |buffers_| is the frontbuffer. 53 // Keeps track of which bitmap is |buffers_| is the frontbuffer.
53 int front_buffer_; 54 int front_buffer_;
54 55
55 // Surface size. 56 // Surface size.
56 gfx::Size size_; 57 gfx::Size size_;
57 58
58 DISALLOW_COPY_AND_ASSIGN(DriSurface); 59 DISALLOW_COPY_AND_ASSIGN(DriSurface);
59 }; 60 };
60 61
61 } // namespace ui 62 } // namespace ui
62 63
63 #endif // UI_OZONE_PLATFORM_DRI_DRI_SURFACE_H_ 64 #endif // UI_OZONE_PLATFORM_DRI_DRI_SURFACE_H_
OLDNEW
« no previous file with comments | « no previous file | ui/ozone/platform/dri/dri_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698