OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 WINDOW_MANAGER_GLES_GLES_VISITOR_H_ | 5 #ifndef WINDOW_MANAGER_GLES_GLES_VISITOR_H_ |
6 #define WINDOW_MANAGER_GLES_GLES_VISITOR_H_ | 6 #define WINDOW_MANAGER_GLES_GLES_VISITOR_H_ |
7 | 7 |
8 #include <GLES2/gl2.h> | 8 #include <GLES2/gl2.h> |
9 #include <EGL/egl.h> | 9 #include <EGL/egl.h> |
10 #include <EGL/eglext.h> | 10 #include <EGL/eglext.h> |
(...skipping 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 void set_damaged_region(Rect damaged_region) { | 39 void set_damaged_region(Rect damaged_region) { |
40 NOTIMPLEMENTED(); | 40 NOTIMPLEMENTED(); |
41 } | 41 } |
42 | 42 |
43 void BindImage(const ImageContainer* container, | 43 void BindImage(const ImageContainer* container, |
44 RealCompositor::QuadActor* actor); | 44 RealCompositor::QuadActor* actor); |
45 | 45 |
46 virtual void VisitActor(RealCompositor::Actor* actor) {} | 46 virtual void VisitActor(RealCompositor::Actor* actor) {} |
47 virtual void VisitStage(RealCompositor::StageActor* actor); | 47 virtual void VisitStage(RealCompositor::StageActor* actor); |
48 virtual void VisitContainer(RealCompositor::ContainerActor* actor); | 48 |
49 virtual void VisitImage(RealCompositor::ImageActor* actor) { | 49 void DrawQuad(RealCompositor::QuadActor* actor, |
50 VisitQuad(actor); | 50 float ancestor_opacity) const; |
51 } | 51 void CreateTextureData(RealCompositor::TexturePixmapActor *actor) const; |
52 virtual void VisitTexturePixmap(RealCompositor::TexturePixmapActor* actor); | |
53 virtual void VisitQuad(RealCompositor::QuadActor* actor); | |
54 | 52 |
55 private: | 53 private: |
56 Gles2Interface* gl_; // Not owned. | 54 Gles2Interface* gl_; // Not owned. |
57 RealCompositor* compositor_; // Not owned. | 55 RealCompositor* compositor_; // Not owned. |
58 Compositor::StageActor* stage_; // Not owned. | 56 Compositor::StageActor* stage_; // Not owned. |
59 XConnection* x_connection_; // Not owned. | 57 XConnection* x_connection_; // Not owned. |
60 | 58 |
61 TexColorShader* tex_color_shader_; | 59 TexColorShader* tex_color_shader_; |
62 TexShadeShader* tex_shade_shader_; | 60 TexShadeShader* tex_shade_shader_; |
63 NoAlphaColorShader* no_alpha_color_shader_; | 61 NoAlphaColorShader* no_alpha_color_shader_; |
64 NoAlphaShadeShader* no_alpha_shade_shader_; | 62 NoAlphaShadeShader* no_alpha_shade_shader_; |
65 | 63 |
66 EGLDisplay egl_display_; | 64 EGLDisplay egl_display_; |
67 EGLSurface egl_surface_; | 65 EGLSurface egl_surface_; |
68 EGLContext egl_context_; | 66 EGLContext egl_context_; |
69 | 67 |
70 // Matrix state | 68 // Matrix state |
71 Matrix4 projection_; | 69 Matrix4 projection_; |
72 | 70 |
73 // Cumulative opacity of the ancestors | |
74 float ancestor_opacity_; | |
75 | 71 |
76 // global vertex buffer object | 72 // global vertex buffer object |
77 GLuint vertex_buffer_object_; | 73 GLuint vertex_buffer_object_; |
78 | 74 |
79 // Temporary storage for client side vertex colors | |
80 GLfloat colors_[4 * 4]; | |
81 | |
82 // This is used to indicate whether the entire screen will be covered by an | 75 // This is used to indicate whether the entire screen will be covered by an |
83 // actor so we can optimize by not clearing the COLOR_BUFFER_BIT. | 76 // actor so we can optimize by not clearing the COLOR_BUFFER_BIT. |
84 bool has_fullscreen_actor_; | 77 bool has_fullscreen_actor_; |
85 | 78 |
86 DISALLOW_COPY_AND_ASSIGN(OpenGlesDrawVisitor); | 79 DISALLOW_COPY_AND_ASSIGN(OpenGlesDrawVisitor); |
87 }; | 80 }; |
88 | 81 |
89 // TODO: further combine texture class between GL and GLES after common GL | 82 // TODO: further combine texture class between GL and GLES after common GL |
90 // functions are combined. | 83 // functions are combined. |
91 class OpenGlesTextureData : public TextureData { | 84 class OpenGlesTextureData : public TextureData { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 Gles2Interface* gl_; | 116 Gles2Interface* gl_; |
124 | 117 |
125 // EGLImage | 118 // EGLImage |
126 EGLImageKHR egl_image_; | 119 EGLImageKHR egl_image_; |
127 }; | 120 }; |
128 | 121 |
129 } // namespace window_manager | 122 } // namespace window_manager |
130 | 123 |
131 #endif // WINDOW_MANAGER_GLES_GLES_VISITOR_H_ | 124 #endif // WINDOW_MANAGER_GLES_GLES_VISITOR_H_ |
132 | 125 |
OLD | NEW |