OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2017 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_GL_GL_SURFACE_FORMAT_H_ | |
6 #define UI_GL_GL_SURFACE_FORMAT_H_ | |
7 | |
8 #include "ui/gl/gl_export.h" | |
9 | |
10 namespace gl { | |
11 | |
12 class GL_EXPORT GLSurfaceFormat { | |
13 public: | |
14 | |
15 // For use with constructor. | |
16 enum SurfacePixelLayout { | |
17 PIXEL_LAYOUT_DONT_CARE = -1, | |
18 PIXEL_LAYOUT_BGRA, | |
19 PIXEL_LAYOUT_RGBA, | |
20 }; | |
21 | |
22 GLSurfaceFormat(); | |
23 | |
24 ~GLSurfaceFormat(); | |
25 | |
26 GLSurfaceFormat(SurfacePixelLayout layout); | |
27 | |
28 GLSurfaceFormat(const GLSurfaceFormat& other); | |
29 | |
30 bool IsDefault(); | |
31 | |
32 void SetIsSurfaceless(); | |
33 bool IsSurfaceless(); | |
34 | |
35 bool IsCompatible(GLSurfaceFormat other_format); | |
36 | |
37 // Default pixel format is RGBA8888. Use this method to select | |
38 // a preference of RGB565. TODO(klausw): use individual setter | |
39 // methods if there's a use case for them. | |
40 void SetRGB565(); | |
41 | |
42 // Other properties for future use. | |
43 void SetDepthBits(int depth_bits); | |
44 int GetDepthBits(); | |
45 | |
46 void SetStencilBits(int stencil_bits); | |
47 int GetStencilBits(); | |
48 | |
49 void SetSamples(int samples); | |
50 int GetSamples(); | |
51 | |
52 void SetDefaultPixelLayout(SurfacePixelLayout layout); | |
53 | |
54 SurfacePixelLayout GetPixelLayout(); | |
55 | |
56 int GetBufferSize(); | |
57 | |
58 private: | |
59 bool is_default = true; | |
jbauman
2017/01/06 02:51:30
is_default_, pixel_layout_, is_surfaceless_, etc.
klausw
2017/01/06 03:44:40
Oops, done.
| |
60 SurfacePixelLayout pixel_layout = PIXEL_LAYOUT_DONT_CARE; | |
61 bool is_surfaceless = false; | |
62 int red_bits = -1; | |
63 int green_bits = -1; | |
64 int blue_bits = -1; | |
65 int alpha_bits = -1; | |
66 int depth_bits = -1; | |
67 int samples = -1; | |
68 int stencil_bits = -1; | |
69 }; | |
70 | |
71 } // namespace gl | |
72 | |
73 #endif // UI_GL_GL_SURFACE_FORMAT_H_ | |
OLD | NEW |