Merge lp:~unity-team/nux/nux.lazy-load-graphics into lp:nux/2.0
- nux.lazy-load-graphics
- Merge into 2.0
Proposed by
Jason Smith
Status: | Merged |
---|---|
Approved by: | Jason Smith |
Approved revision: | 562 |
Merged at revision: | 560 |
Proposed branch: | lp:~unity-team/nux/nux.lazy-load-graphics |
Merge into: | lp:nux/2.0 |
Diff against target: |
334 lines (+66/-87) 4 files modified
Nux/View.cpp (+2/-1) Nux/View.h (+1/-1) NuxGraphics/GraphicsEngine.cpp (+31/-69) NuxGraphics/RenderingPipeGLSL.cpp (+32/-16) |
To merge this branch: | bzr merge lp:~unity-team/nux/nux.lazy-load-graphics |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jay Taoko (community) | Approve | ||
Thomi Richards (community) | Approve | ||
Review via email: mp+92211@code.launchpad.net |
Commit message
Description of the change
Makes nux lazy load some of its less frequently use, yet more expensive objects
To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote : | # |
review:
Approve
Revision history for this message
Jay Taoko (jaytaoko) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Nux/View.cpp' | |||
2 | --- Nux/View.cpp 2012-01-24 23:16:53 +0000 | |||
3 | +++ Nux/View.cpp 2012-02-09 06:06:19 +0000 | |||
4 | @@ -33,7 +33,6 @@ | |||
5 | 33 | View::View(NUX_FILE_LINE_DECL) | 33 | View::View(NUX_FILE_LINE_DECL) |
6 | 34 | : InputArea(NUX_FILE_LINE_PARAM) | 34 | : InputArea(NUX_FILE_LINE_PARAM) |
7 | 35 | { | 35 | { |
8 | 36 | _font = GetSysFont(); | ||
9 | 37 | view_layout_ = NULL; | 36 | view_layout_ = NULL; |
10 | 38 | draw_cmd_queued_ = false; | 37 | draw_cmd_queued_ = false; |
11 | 39 | m_TextColor = Color(1.0f, 1.0f, 1.0f, 1.0f); | 38 | m_TextColor = Color(1.0f, 1.0f, 1.0f, 1.0f); |
12 | @@ -369,6 +368,8 @@ | |||
13 | 369 | 368 | ||
14 | 370 | ObjectPtr<FontTexture> View::GetFont() | 369 | ObjectPtr<FontTexture> View::GetFont() |
15 | 371 | { | 370 | { |
16 | 371 | if (!_font.IsValid()) | ||
17 | 372 | _font = GetSysFont(); | ||
18 | 372 | return _font; | 373 | return _font; |
19 | 373 | } | 374 | } |
20 | 374 | 375 | ||
21 | 375 | 376 | ||
22 | === modified file 'Nux/View.h' | |||
23 | --- Nux/View.h 2012-01-02 21:43:19 +0000 | |||
24 | +++ Nux/View.h 2012-02-09 06:06:19 +0000 | |||
25 | @@ -166,7 +166,6 @@ | |||
26 | 166 | void InitializeLayout(); | 166 | void InitializeLayout(); |
27 | 167 | 167 | ||
28 | 168 | Color m_TextColor; | 168 | Color m_TextColor; |
29 | 169 | ObjectPtr<FontTexture> _font; | ||
30 | 170 | 169 | ||
31 | 171 | //! Deprecated. Use GetLayout(); | 170 | //! Deprecated. Use GetLayout(); |
32 | 172 | virtual Layout* GetCompositionLayout(); | 171 | virtual Layout* GetCompositionLayout(); |
33 | @@ -201,6 +200,7 @@ | |||
34 | 201 | bool full_view_draw_cmd_; //<! True if Draw is called before ContentDraw. It is read-only and can be accessed by calling IsFullRedraw(); | 200 | bool full_view_draw_cmd_; //<! True if Draw is called before ContentDraw. It is read-only and can be accessed by calling IsFullRedraw(); |
35 | 202 | 201 | ||
36 | 203 | private: | 202 | private: |
37 | 203 | ObjectPtr<FontTexture> _font; | ||
38 | 204 | 204 | ||
39 | 205 | friend class WindowCompositor; | 205 | friend class WindowCompositor; |
40 | 206 | friend class Layout; | 206 | friend class Layout; |
41 | 207 | 207 | ||
42 | === modified file 'NuxGraphics/GraphicsEngine.cpp' | |||
43 | --- NuxGraphics/GraphicsEngine.cpp 2012-01-23 01:02:28 +0000 | |||
44 | +++ NuxGraphics/GraphicsEngine.cpp 2012-02-09 06:06:19 +0000 | |||
45 | @@ -196,31 +196,7 @@ | |||
46 | 196 | if (create_rendering_data) | 196 | if (create_rendering_data) |
47 | 197 | { | 197 | { |
48 | 198 | #ifndef NUX_OPENGLES_20 | 198 | #ifndef NUX_OPENGLES_20 |
74 | 199 | if (UsingGLSLCodePath() && | 199 | if (_graphics_display.GetGpuDevice()->GetGpuInfo().Support_ARB_Fragment_Shader() && |
50 | 200 | _graphics_display.GetGpuDevice()->GetGpuInfo().Support_ARB_Fragment_Shader() && | ||
51 | 201 | _graphics_display.GetGpuDevice()->GetGpuInfo().Support_ARB_Vertex_Shader() && | ||
52 | 202 | opengl_14_support) | ||
53 | 203 | { | ||
54 | 204 | InitSlColorShader(); | ||
55 | 205 | InitSlTextureShader(); | ||
56 | 206 | InitSlPixelateShader(); | ||
57 | 207 | InitSlColorModTexMaskAlpha(); | ||
58 | 208 | InitSl2TextureAdd(); | ||
59 | 209 | InitSl2TextureMod(); | ||
60 | 210 | InitSl4TextureAdd(); | ||
61 | 211 | |||
62 | 212 | InitSLPower(); | ||
63 | 213 | InitSLAlphaReplicate(); | ||
64 | 214 | InitSLHorizontalGaussFilter(); | ||
65 | 215 | InitSLVerticalGaussFilter(); | ||
66 | 216 | InitSLColorMatrixFilter(); | ||
67 | 217 | |||
68 | 218 | InitSl2TextureDepRead(); | ||
69 | 219 | |||
70 | 220 | InitSLHorizontalHQGaussFilter(1); | ||
71 | 221 | InitSLVerticalHQGaussFilter(1); | ||
72 | 222 | } | ||
73 | 223 | else if (_graphics_display.GetGpuDevice()->GetGpuInfo().Support_ARB_Fragment_Shader() && | ||
75 | 224 | _graphics_display.GetGpuDevice()->GetGpuInfo().Support_ARB_Vertex_Program() && | 200 | _graphics_display.GetGpuDevice()->GetGpuInfo().Support_ARB_Vertex_Program() && |
76 | 225 | opengl_14_support) | 201 | opengl_14_support) |
77 | 226 | { | 202 | { |
78 | @@ -240,50 +216,6 @@ | |||
79 | 240 | 216 | ||
80 | 241 | //InitAsm2TextureDepRead(); // NUXTODO: fix the shader | 217 | //InitAsm2TextureDepRead(); // NUXTODO: fix the shader |
81 | 242 | } | 218 | } |
82 | 243 | #else | ||
83 | 244 | InitSlColorShader(); | ||
84 | 245 | InitSlTextureShader(); | ||
85 | 246 | InitSlPixelateShader(); | ||
86 | 247 | InitSlColorModTexMaskAlpha(); | ||
87 | 248 | InitSl2TextureAdd(); | ||
88 | 249 | InitSl2TextureMod(); | ||
89 | 250 | InitSl4TextureAdd(); | ||
90 | 251 | |||
91 | 252 | InitSLPower(); | ||
92 | 253 | InitSLAlphaReplicate(); | ||
93 | 254 | InitSLHorizontalGaussFilter(); | ||
94 | 255 | InitSLVerticalGaussFilter(); | ||
95 | 256 | InitSLColorMatrixFilter(); | ||
96 | 257 | #endif | ||
97 | 258 | |||
98 | 259 | #if defined(NUX_OS_WINDOWS) | ||
99 | 260 | if (_normal_font.IsNull()) | ||
100 | 261 | { | ||
101 | 262 | FontTexture* fnt = new FontTexture(GNuxGraphicsResources.FindResourceLocation("Fonts/Tahoma_size_8.txt", true).GetTCharPtr(), NUX_TRACKER_LOCATION); | ||
102 | 263 | _normal_font = ObjectPtr<FontTexture> (fnt); | ||
103 | 264 | fnt->UnReference(); | ||
104 | 265 | } | ||
105 | 266 | |||
106 | 267 | if (_bold_font.IsNull()) | ||
107 | 268 | { | ||
108 | 269 | FontTexture* fnt = new FontTexture(GNuxGraphicsResources.FindResourceLocation("Fonts/Tahoma_size_8_bold.txt", true).GetTCharPtr(), NUX_TRACKER_LOCATION); | ||
109 | 270 | _bold_font = ObjectPtr<FontTexture> (fnt); | ||
110 | 271 | fnt->UnReference(); | ||
111 | 272 | } | ||
112 | 273 | #else | ||
113 | 274 | if (_normal_font.IsNull()) | ||
114 | 275 | { | ||
115 | 276 | FontTexture* fnt = new FontTexture(GNuxGraphicsResources.FindResourceLocation("Fonts/nuxfont_size_8.txt", true).GetTCharPtr(), NUX_TRACKER_LOCATION); | ||
116 | 277 | _normal_font = ObjectPtr<FontTexture> (fnt); | ||
117 | 278 | fnt->UnReference(); | ||
118 | 279 | } | ||
119 | 280 | |||
120 | 281 | if (_bold_font.IsNull()) | ||
121 | 282 | { | ||
122 | 283 | FontTexture* fnt = new FontTexture(GNuxGraphicsResources.FindResourceLocation("Fonts/nuxfont_size_8_bold.txt", true).GetTCharPtr(), NUX_TRACKER_LOCATION); | ||
123 | 284 | _bold_font = ObjectPtr<FontTexture> (fnt); | ||
124 | 285 | fnt->UnReference(); | ||
125 | 286 | } | ||
126 | 287 | #endif | 219 | #endif |
127 | 288 | 220 | ||
128 | 289 | GpuInfo& gpu_info = _graphics_display.GetGpuDevice()->GetGpuInfo(); | 221 | GpuInfo& gpu_info = _graphics_display.GetGpuDevice()->GetGpuInfo(); |
129 | @@ -364,11 +296,41 @@ | |||
130 | 364 | 296 | ||
131 | 365 | ObjectPtr<FontTexture> GraphicsEngine::GetFont() | 297 | ObjectPtr<FontTexture> GraphicsEngine::GetFont() |
132 | 366 | { | 298 | { |
133 | 299 | #if defined(NUX_OS_WINDOWS) | ||
134 | 300 | if (_normal_font.IsNull()) | ||
135 | 301 | { | ||
136 | 302 | FontTexture* fnt = new FontTexture(GNuxGraphicsResources.FindResourceLocation("Fonts/Tahoma_size_8.txt", true).GetTCharPtr(), NUX_TRACKER_LOCATION); | ||
137 | 303 | _normal_font = ObjectPtr<FontTexture> (fnt); | ||
138 | 304 | fnt->UnReference(); | ||
139 | 305 | } | ||
140 | 306 | #else | ||
141 | 307 | if (_normal_font.IsNull()) | ||
142 | 308 | { | ||
143 | 309 | FontTexture* fnt = new FontTexture(GNuxGraphicsResources.FindResourceLocation("Fonts/nuxfont_size_8.txt", true).GetTCharPtr(), NUX_TRACKER_LOCATION); | ||
144 | 310 | _normal_font = ObjectPtr<FontTexture> (fnt); | ||
145 | 311 | fnt->UnReference(); | ||
146 | 312 | } | ||
147 | 313 | #endif | ||
148 | 367 | return _normal_font; | 314 | return _normal_font; |
149 | 368 | } | 315 | } |
150 | 369 | 316 | ||
151 | 370 | ObjectPtr<FontTexture> GraphicsEngine::GetBoldFont() | 317 | ObjectPtr<FontTexture> GraphicsEngine::GetBoldFont() |
152 | 371 | { | 318 | { |
153 | 319 | #if defined(NUX_OS_WINDOWS) | ||
154 | 320 | if (_bold_font.IsNull()) | ||
155 | 321 | { | ||
156 | 322 | FontTexture* fnt = new FontTexture(GNuxGraphicsResources.FindResourceLocation("Fonts/Tahoma_size_8_bold.txt", true).GetTCharPtr(), NUX_TRACKER_LOCATION); | ||
157 | 323 | _bold_font = ObjectPtr<FontTexture> (fnt); | ||
158 | 324 | fnt->UnReference(); | ||
159 | 325 | } | ||
160 | 326 | #else | ||
161 | 327 | if (_bold_font.IsNull()) | ||
162 | 328 | { | ||
163 | 329 | FontTexture* fnt = new FontTexture(GNuxGraphicsResources.FindResourceLocation("Fonts/nuxfont_size_8_bold.txt", true).GetTCharPtr(), NUX_TRACKER_LOCATION); | ||
164 | 330 | _bold_font = ObjectPtr<FontTexture> (fnt); | ||
165 | 331 | fnt->UnReference(); | ||
166 | 332 | } | ||
167 | 333 | #endif | ||
168 | 372 | return _bold_font; | 334 | return _bold_font; |
169 | 373 | } | 335 | } |
170 | 374 | 336 | ||
171 | 375 | 337 | ||
172 | === modified file 'NuxGraphics/RenderingPipeGLSL.cpp' | |||
173 | --- NuxGraphics/RenderingPipeGLSL.cpp 2012-01-15 21:45:36 +0000 | |||
174 | +++ NuxGraphics/RenderingPipeGLSL.cpp 2012-02-09 06:06:19 +0000 | |||
175 | @@ -875,7 +875,8 @@ | |||
176 | 875 | 875 | ||
177 | 876 | void GraphicsEngine::QRP_GLSL_Color(int x, int y, int width, int height, const Color &c0, const Color &c1, const Color &c2, const Color &c3) | 876 | void GraphicsEngine::QRP_GLSL_Color(int x, int y, int width, int height, const Color &c0, const Color &c1, const Color &c2, const Color &c3) |
178 | 877 | { | 877 | { |
180 | 878 | NUX_RETURN_IF_FALSE(m_SlColor.IsValid()); | 878 | if (!m_SlColor.IsValid()) |
181 | 879 | InitSlColorShader(); | ||
182 | 879 | 880 | ||
183 | 880 | m_quad_tex_stats++; | 881 | m_quad_tex_stats++; |
184 | 881 | 882 | ||
185 | @@ -922,7 +923,8 @@ | |||
186 | 922 | 923 | ||
187 | 923 | void GraphicsEngine::QRP_GLSL_1Tex(int x, int y, int width, int height, ObjectPtr<IOpenGLBaseTexture> DeviceTexture, TexCoordXForm &texxform0, const Color &color0) | 924 | void GraphicsEngine::QRP_GLSL_1Tex(int x, int y, int width, int height, ObjectPtr<IOpenGLBaseTexture> DeviceTexture, TexCoordXForm &texxform0, const Color &color0) |
188 | 924 | { | 925 | { |
190 | 925 | NUX_RETURN_IF_FALSE(m_SlTextureModColor.IsValid()); | 926 | if (!m_SlTextureModColor.IsValid()) |
191 | 927 | InitSlTextureShader(); | ||
192 | 926 | 928 | ||
193 | 927 | m_quad_tex_stats++; | 929 | m_quad_tex_stats++; |
194 | 928 | QRP_Compute_Texture_Coord(width, height, DeviceTexture, texxform0); | 930 | QRP_Compute_Texture_Coord(width, height, DeviceTexture, texxform0); |
195 | @@ -996,7 +998,8 @@ | |||
196 | 996 | void GraphicsEngine::QRP_GLSL_ColorModTexAlpha(int x, int y, int width, int height, | 998 | void GraphicsEngine::QRP_GLSL_ColorModTexAlpha(int x, int y, int width, int height, |
197 | 997 | ObjectPtr< IOpenGLBaseTexture> DeviceTexture, TexCoordXForm &texxform, const Color &color) | 999 | ObjectPtr< IOpenGLBaseTexture> DeviceTexture, TexCoordXForm &texxform, const Color &color) |
198 | 998 | { | 1000 | { |
200 | 999 | NUX_RETURN_IF_FALSE(m_SlColorModTexMaskAlpha.IsValid()); | 1001 | if (!m_SlColorModTexMaskAlpha.IsValid()) |
201 | 1002 | InitSlColorModTexMaskAlpha(); | ||
202 | 1000 | 1003 | ||
203 | 1001 | m_quad_tex_stats++; | 1004 | m_quad_tex_stats++; |
204 | 1002 | QRP_Compute_Texture_Coord(width, height, DeviceTexture, texxform); | 1005 | QRP_Compute_Texture_Coord(width, height, DeviceTexture, texxform); |
205 | @@ -1083,7 +1086,8 @@ | |||
206 | 1083 | ObjectPtr<IOpenGLBaseTexture> DeviceTexture0, TexCoordXForm &texxform0, const Color &color0, | 1086 | ObjectPtr<IOpenGLBaseTexture> DeviceTexture0, TexCoordXForm &texxform0, const Color &color0, |
207 | 1084 | ObjectPtr<IOpenGLBaseTexture> DeviceTexture1, TexCoordXForm &texxform1, const Color &color1) | 1087 | ObjectPtr<IOpenGLBaseTexture> DeviceTexture1, TexCoordXForm &texxform1, const Color &color1) |
208 | 1085 | { | 1088 | { |
210 | 1086 | NUX_RETURN_IF_FALSE(m_Sl2TextureAdd.IsValid()); | 1089 | if (!m_Sl2TextureAdd.IsValid()) |
211 | 1090 | InitSl2TextureAdd(); | ||
212 | 1087 | 1091 | ||
213 | 1088 | ObjectPtr<IOpenGLShaderProgram> ShaderProg; | 1092 | ObjectPtr<IOpenGLShaderProgram> ShaderProg; |
214 | 1089 | ShaderProg = m_Sl2TextureAdd; | 1093 | ShaderProg = m_Sl2TextureAdd; |
215 | @@ -1160,7 +1164,8 @@ | |||
216 | 1160 | ObjectPtr<IOpenGLBaseTexture> distorsion_texture, TexCoordXForm &texxform0, const Color& c0, | 1164 | ObjectPtr<IOpenGLBaseTexture> distorsion_texture, TexCoordXForm &texxform0, const Color& c0, |
217 | 1161 | ObjectPtr<IOpenGLBaseTexture> src_device_texture, TexCoordXForm &texxform1, const Color& c1) | 1165 | ObjectPtr<IOpenGLBaseTexture> src_device_texture, TexCoordXForm &texxform1, const Color& c1) |
218 | 1162 | { | 1166 | { |
220 | 1163 | NUX_RETURN_IF_FALSE(m_Sl2TextureDepRead.IsValid()); | 1167 | if (!m_Sl2TextureDepRead.IsValid()) |
221 | 1168 | InitSl2TextureDepRead(); | ||
222 | 1164 | 1169 | ||
223 | 1165 | ObjectPtr<IOpenGLShaderProgram> ShaderProg = m_Sl2TextureDepRead; | 1170 | ObjectPtr<IOpenGLShaderProgram> ShaderProg = m_Sl2TextureDepRead; |
224 | 1166 | 1171 | ||
225 | @@ -1235,7 +1240,8 @@ | |||
226 | 1235 | ObjectPtr<IOpenGLBaseTexture> DeviceTexture0, TexCoordXForm &texxform0, const Color &color0, | 1240 | ObjectPtr<IOpenGLBaseTexture> DeviceTexture0, TexCoordXForm &texxform0, const Color &color0, |
227 | 1236 | ObjectPtr<IOpenGLBaseTexture> DeviceTexture1, TexCoordXForm &texxform1, const Color &color1) | 1241 | ObjectPtr<IOpenGLBaseTexture> DeviceTexture1, TexCoordXForm &texxform1, const Color &color1) |
228 | 1237 | { | 1242 | { |
230 | 1238 | NUX_RETURN_IF_FALSE(m_Sl2TextureMod.IsValid()); | 1243 | if (!m_Sl2TextureMod.IsValid()) |
231 | 1244 | InitSl2TextureMod(); | ||
232 | 1239 | 1245 | ||
233 | 1240 | ObjectPtr<IOpenGLShaderProgram> ShaderProg; | 1246 | ObjectPtr<IOpenGLShaderProgram> ShaderProg; |
234 | 1241 | { | 1247 | { |
235 | @@ -1315,7 +1321,8 @@ | |||
236 | 1315 | ObjectPtr<IOpenGLBaseTexture> DeviceTexture2, TexCoordXForm &texxform2, const Color &color2, | 1321 | ObjectPtr<IOpenGLBaseTexture> DeviceTexture2, TexCoordXForm &texxform2, const Color &color2, |
237 | 1316 | ObjectPtr<IOpenGLBaseTexture> DeviceTexture3, TexCoordXForm &texxform3, const Color &color3) | 1322 | ObjectPtr<IOpenGLBaseTexture> DeviceTexture3, TexCoordXForm &texxform3, const Color &color3) |
238 | 1317 | { | 1323 | { |
240 | 1318 | NUX_RETURN_IF_FALSE(m_Sl4TextureAdd.IsValid()); | 1324 | if (!m_Sl4TextureAdd.IsValid()) |
241 | 1325 | InitSl4TextureAdd(); | ||
242 | 1319 | 1326 | ||
243 | 1320 | QRP_Compute_Texture_Coord(width, height, DeviceTexture0, texxform0); | 1327 | QRP_Compute_Texture_Coord(width, height, DeviceTexture0, texxform0); |
244 | 1321 | QRP_Compute_Texture_Coord(width, height, DeviceTexture1, texxform1); | 1328 | QRP_Compute_Texture_Coord(width, height, DeviceTexture1, texxform1); |
245 | @@ -1431,7 +1438,8 @@ | |||
246 | 1431 | int x2, int y2, | 1438 | int x2, int y2, |
247 | 1432 | Color c0, Color c1, Color c2) | 1439 | Color c0, Color c1, Color c2) |
248 | 1433 | { | 1440 | { |
250 | 1434 | NUX_RETURN_IF_FALSE(m_SlColor.IsValid()); | 1441 | if (!m_SlColor.IsValid()) |
251 | 1442 | InitSlColorShader(); | ||
252 | 1435 | 1443 | ||
253 | 1436 | float VtxBuffer[] = | 1444 | float VtxBuffer[] = |
254 | 1437 | { | 1445 | { |
255 | @@ -1479,7 +1487,8 @@ | |||
256 | 1479 | void GraphicsEngine::QRP_GLSL_Line(int x0, int y0, | 1487 | void GraphicsEngine::QRP_GLSL_Line(int x0, int y0, |
257 | 1480 | int x1, int y1, Color c0, Color c1) | 1488 | int x1, int y1, Color c0, Color c1) |
258 | 1481 | { | 1489 | { |
260 | 1482 | NUX_RETURN_IF_FALSE(m_SlColor.IsValid()); | 1490 | if (!m_SlColor.IsValid()) |
261 | 1491 | InitSlColorShader(); | ||
262 | 1483 | 1492 | ||
263 | 1484 | float VtxBuffer[] = | 1493 | float VtxBuffer[] = |
264 | 1485 | { | 1494 | { |
265 | @@ -1542,7 +1551,8 @@ | |||
266 | 1542 | Color c2, | 1551 | Color c2, |
267 | 1543 | Color c3) | 1552 | Color c3) |
268 | 1544 | { | 1553 | { |
270 | 1545 | NUX_RETURN_IF_FALSE(m_SlColor.IsValid()); | 1554 | if (!m_SlColor.IsValid()) |
271 | 1555 | InitSlColorShader(); | ||
272 | 1546 | 1556 | ||
273 | 1547 | float fx0 = x0, fy0 = y0; | 1557 | float fx0 = x0, fy0 = y0; |
274 | 1548 | float VtxBuffer[] = | 1558 | float VtxBuffer[] = |
275 | @@ -1605,7 +1615,8 @@ | |||
276 | 1605 | 1615 | ||
277 | 1606 | void GraphicsEngine::QRP_GLSL_Power(int x, int y, int width, int height, ObjectPtr<IOpenGLBaseTexture> device_texture, TexCoordXForm &texxform0, const Color &c0, Vector4 exponent) | 1616 | void GraphicsEngine::QRP_GLSL_Power(int x, int y, int width, int height, ObjectPtr<IOpenGLBaseTexture> device_texture, TexCoordXForm &texxform0, const Color &c0, Vector4 exponent) |
278 | 1607 | { | 1617 | { |
280 | 1608 | NUX_RETURN_IF_FALSE(_component_exponentiation_prog.IsValid()); | 1618 | if (!_component_exponentiation_prog.IsValid()) |
281 | 1619 | InitSLPower(); | ||
282 | 1609 | 1620 | ||
283 | 1610 | m_quad_tex_stats++; | 1621 | m_quad_tex_stats++; |
284 | 1611 | QRP_Compute_Texture_Coord(width, height, device_texture, texxform0); | 1622 | QRP_Compute_Texture_Coord(width, height, device_texture, texxform0); |
285 | @@ -1671,7 +1682,8 @@ | |||
286 | 1671 | 1682 | ||
287 | 1672 | void GraphicsEngine::QRP_GLSL_AlphaReplicate(int x, int y, int width, int height, ObjectPtr<IOpenGLBaseTexture> device_texture, TexCoordXForm &texxform0, const Color &c0) | 1683 | void GraphicsEngine::QRP_GLSL_AlphaReplicate(int x, int y, int width, int height, ObjectPtr<IOpenGLBaseTexture> device_texture, TexCoordXForm &texxform0, const Color &c0) |
288 | 1673 | { | 1684 | { |
290 | 1674 | NUX_RETURN_IF_FALSE(_alpha_replicate_prog.IsValid()); | 1685 | if (!_alpha_replicate_prog.IsValid()) |
291 | 1686 | InitSLAlphaReplicate(); | ||
292 | 1675 | 1687 | ||
293 | 1676 | m_quad_tex_stats++; | 1688 | m_quad_tex_stats++; |
294 | 1677 | QRP_Compute_Texture_Coord(width, height, device_texture, texxform0); | 1689 | QRP_Compute_Texture_Coord(width, height, device_texture, texxform0); |
295 | @@ -1734,7 +1746,8 @@ | |||
296 | 1734 | 1746 | ||
297 | 1735 | void GraphicsEngine::QRP_GLSL_HorizontalGauss(int x, int y, int width, int height, ObjectPtr<IOpenGLBaseTexture> device_texture, TexCoordXForm &texxform0, const Color &c0, float sigma) | 1747 | void GraphicsEngine::QRP_GLSL_HorizontalGauss(int x, int y, int width, int height, ObjectPtr<IOpenGLBaseTexture> device_texture, TexCoordXForm &texxform0, const Color &c0, float sigma) |
298 | 1736 | { | 1748 | { |
300 | 1737 | NUX_RETURN_IF_FALSE(_horizontal_gauss_filter_prog.IsValid()); | 1749 | if (!_horizontal_gauss_filter_prog.IsValid()) |
301 | 1750 | InitSLHorizontalGaussFilter(); | ||
302 | 1738 | 1751 | ||
303 | 1739 | m_quad_tex_stats++; | 1752 | m_quad_tex_stats++; |
304 | 1740 | QRP_Compute_Texture_Coord(width, height, device_texture, texxform0); | 1753 | QRP_Compute_Texture_Coord(width, height, device_texture, texxform0); |
305 | @@ -1805,7 +1818,8 @@ | |||
306 | 1805 | 1818 | ||
307 | 1806 | void GraphicsEngine::QRP_GLSL_VerticalGauss(int x, int y, int width, int height, ObjectPtr<IOpenGLBaseTexture> device_texture, TexCoordXForm &texxform0, const Color &c0, float sigma) | 1819 | void GraphicsEngine::QRP_GLSL_VerticalGauss(int x, int y, int width, int height, ObjectPtr<IOpenGLBaseTexture> device_texture, TexCoordXForm &texxform0, const Color &c0, float sigma) |
308 | 1807 | { | 1820 | { |
310 | 1808 | NUX_RETURN_IF_FALSE(_vertical_gauss_filter_prog.IsValid()); | 1821 | if (!_vertical_gauss_filter_prog.IsValid()) |
311 | 1822 | InitSLVerticalGaussFilter(); | ||
312 | 1809 | 1823 | ||
313 | 1810 | m_quad_tex_stats++; | 1824 | m_quad_tex_stats++; |
314 | 1811 | QRP_Compute_Texture_Coord(width, height, device_texture, texxform0); | 1825 | QRP_Compute_Texture_Coord(width, height, device_texture, texxform0); |
315 | @@ -2035,7 +2049,8 @@ | |||
316 | 2035 | Matrix4 color_matrix, | 2049 | Matrix4 color_matrix, |
317 | 2036 | Vector4 offset) | 2050 | Vector4 offset) |
318 | 2037 | { | 2051 | { |
320 | 2038 | NUX_RETURN_IF_FALSE(_color_matrix_filter_prog.IsValid()); | 2052 | if (!_color_matrix_filter_prog.IsValid()) |
321 | 2053 | InitSLColorMatrixFilter(); | ||
322 | 2039 | 2054 | ||
323 | 2040 | m_quad_tex_stats++; | 2055 | m_quad_tex_stats++; |
324 | 2041 | QRP_Compute_Texture_Coord(width, height, device_texture, texxform0); | 2056 | QRP_Compute_Texture_Coord(width, height, device_texture, texxform0); |
325 | @@ -2673,7 +2688,8 @@ | |||
326 | 2673 | 2688 | ||
327 | 2674 | void GraphicsEngine::QRP_GLSL_Pixelate(int x, int y, int width, int height, ObjectPtr<IOpenGLBaseTexture> DeviceTexture, TexCoordXForm &texxform0, const Color &color0, int pixel_size) | 2689 | void GraphicsEngine::QRP_GLSL_Pixelate(int x, int y, int width, int height, ObjectPtr<IOpenGLBaseTexture> DeviceTexture, TexCoordXForm &texxform0, const Color &color0, int pixel_size) |
328 | 2675 | { | 2690 | { |
330 | 2676 | NUX_RETURN_IF_FALSE(m_SLPixelate.IsValid()); | 2691 | if (!m_SLPixelate.IsValid()) |
331 | 2692 | InitSlPixelateShader(); | ||
332 | 2677 | 2693 | ||
333 | 2678 | m_quad_tex_stats++; | 2694 | m_quad_tex_stats++; |
334 | 2679 | QRP_Compute_Texture_Coord(width, height, DeviceTexture, texxform0); | 2695 | QRP_Compute_Texture_Coord(width, height, DeviceTexture, texxform0); |
This looks fine to me, but someone who knows nux should look over it as well.