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_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/ref_counted.h" |
10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
11 #include "ui/gfx/skia_util.h" | 11 #include "ui/gfx/skia_util.h" |
12 #include "ui/ozone/platform/dri/scanout_surface.h" | 12 #include "ui/ozone/platform/dri/scanout_surface.h" |
13 | 13 |
14 class SkCanvas; | 14 class SkCanvas; |
15 | 15 |
16 namespace ui { | 16 namespace ui { |
17 | 17 |
18 class DriBuffer; | 18 class DriBuffer; |
19 class DriWrapper; | 19 class DriWrapper; |
(...skipping 18 matching lines...) Expand all Loading... |
38 | 38 |
39 private: | 39 private: |
40 DriBuffer* frontbuffer() const { return bitmaps_[front_buffer_].get(); } | 40 DriBuffer* frontbuffer() const { return bitmaps_[front_buffer_].get(); } |
41 DriBuffer* backbuffer() const { return bitmaps_[front_buffer_ ^ 1].get(); } | 41 DriBuffer* backbuffer() const { return bitmaps_[front_buffer_ ^ 1].get(); } |
42 | 42 |
43 // Stores the connection to the graphics card. Pointer not owned by this | 43 // Stores the connection to the graphics card. Pointer not owned by this |
44 // class. | 44 // class. |
45 DriWrapper* dri_; | 45 DriWrapper* dri_; |
46 | 46 |
47 // The actual buffers used for painting. | 47 // The actual buffers used for painting. |
48 scoped_ptr<DriBuffer> bitmaps_[2]; | 48 scoped_refptr<DriBuffer> bitmaps_[2]; |
49 | 49 |
50 // Keeps track of which bitmap is |buffers_| is the frontbuffer. | 50 // Keeps track of which bitmap is |buffers_| is the frontbuffer. |
51 int front_buffer_; | 51 int front_buffer_; |
52 | 52 |
53 // Surface size. | 53 // Surface size. |
54 gfx::Size size_; | 54 gfx::Size size_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(DriSurface); | 56 DISALLOW_COPY_AND_ASSIGN(DriSurface); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace ui | 59 } // namespace ui |
60 | 60 |
61 #endif // UI_OZONE_PLATFORM_DRI_DRI_SURFACE_H_ | 61 #endif // UI_OZONE_PLATFORM_DRI_DRI_SURFACE_H_ |
OLD | NEW |