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

Side by Side Diff: ui/gl/gl_surface_format.h

Issue 2616723002: Refactor GL surface format handling (Closed)
Patch Set: Created 3 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
OLDNEW
(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 namespace gl {
9
10 class GLSurfaceFormat {
11 public:
12
13 // Minimum bit depth and format of surface.
14 enum SurfaceFormat {
15 SURFACE_ARGB8888,
16 SURFACE_RGB565,
17 SURFACE_OSMESA_BGRA,
18 SURFACE_OSMESA_RGBA,
19 SURFACE_SURFACELESS,
20 };
21
22 enum SurfacePixelLayout {
23 SURFACE_PIXEL_LAYOUT_DONT_CARE = -1,
24 SURFACE_PIXEL_LAYOUT_BGRA,
25 SURFACE_PIXEL_LAYOUT_RGBA,
26 };
27
28 GLSurfaceFormat();
29
30 GLSurfaceFormat(SurfaceFormat format);
31
32 bool IsDefault();
33
34 bool IsSurfaceless();
35
36 bool IsCompatible(GLSurfaceFormat other_format);
37
38 void SetDepthBits(int depth_bits);
39 void SetStencilBits(int stencil_bits);
40 void SetSamples(int samples);
41
42 SurfacePixelLayout GetPixelLayout();
43
44 int GetBufferSize();
45
46 private:
47 bool is_default = true;
48 bool is_surfaceless = false;
49 int red_bits = -1;
50 int green_bits = -1;
51 int blue_bits = -1;
52 int alpha_bits = -1;
53 int depth_bits = -1;
54 int samples = -1;
55 int stencil_bits = -1;
56 SurfacePixelLayout pixel_layout = SURFACE_PIXEL_LAYOUT_DONT_CARE;
57 };
58
59 } // namespace gl
60
61 #endif // UI_GL_GL_SURFACE_FORMAT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698