blob: 9c4cb098b4c3c42cb503ccaab95dd27cea466320 [file] [log] [blame]
Romain Guy5cbbce52010-06-27 22:59:20 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Romain Guy5b3b3522010-10-27 18:57:51 -070017#ifndef ANDROID_HWUI_PROGRAM_H
18#define ANDROID_HWUI_PROGRAM_H
Romain Guy5cbbce52010-06-27 22:59:20 -070019
Romain Guyf3a910b42011-12-12 20:35:21 -080020#include <utils/KeyedVector.h>
21
Romain Guy5cbbce52010-06-27 22:59:20 -070022#include <GLES2/gl2.h>
23#include <GLES2/gl2ext.h>
24
Mike Reedc2f31df2016-10-28 17:21:45 -040025#include <SkBlendMode.h>
Romain Guy5cbbce52010-06-27 22:59:20 -070026
Chris Craik096b8d92013-03-01 11:08:11 -080027#include "Debug.h"
Chris Craik0519c8102015-02-11 13:17:06 -080028#include "FloatColor.h"
Romain Guy0b9db912010-07-09 18:53:25 -070029#include "Matrix.h"
Romain Guyf3a910b42011-12-12 20:35:21 -080030#include "Properties.h"
Romain Guy0b9db912010-07-09 18:53:25 -070031
Romain Guy5cbbce52010-06-27 22:59:20 -070032namespace android {
33namespace uirenderer {
34
Romain Guyf3a910b42011-12-12 20:35:21 -080035///////////////////////////////////////////////////////////////////////////////
36// Defines
37///////////////////////////////////////////////////////////////////////////////
38
39// Debug
40#if DEBUG_PROGRAMS
Steve Block5baa3a62011-12-20 16:23:08 +000041 #define PROGRAM_LOGD(...) ALOGD(__VA_ARGS__)
Romain Guyf3a910b42011-12-12 20:35:21 -080042#else
43 #define PROGRAM_LOGD(...)
44#endif
45
Romain Guyf8773082012-07-12 18:01:00 -070046#define COLOR_COMPONENT_THRESHOLD 1.0f
47#define COLOR_COMPONENT_INV_THRESHOLD 0.0f
Romain Guyf3a910b42011-12-12 20:35:21 -080048
Chris Craikdeeda3d2014-05-05 19:09:33 -070049#define PROGRAM_KEY_TEXTURE 0x01
50#define PROGRAM_KEY_A8_TEXTURE 0x02
51#define PROGRAM_KEY_BITMAP 0x04
52#define PROGRAM_KEY_GRADIENT 0x08
53#define PROGRAM_KEY_BITMAP_FIRST 0x10
54#define PROGRAM_KEY_COLOR_MATRIX 0x20
55#define PROGRAM_KEY_COLOR_BLEND 0x40
56#define PROGRAM_KEY_BITMAP_NPOT 0x80
Romain Guyf3a910b42011-12-12 20:35:21 -080057
Chris Craikdeeda3d2014-05-05 19:09:33 -070058#define PROGRAM_KEY_SWAP_SRC_DST 0x2000
59
60#define PROGRAM_KEY_BITMAP_WRAPS_MASK 0x600
Romain Guyf3a910b42011-12-12 20:35:21 -080061#define PROGRAM_KEY_BITMAP_WRAPT_MASK 0x1800
62
63// Encode the xfermodes on 6 bits
64#define PROGRAM_MAX_XFERMODE 0x1f
65#define PROGRAM_XFERMODE_SHADER_SHIFT 26
66#define PROGRAM_XFERMODE_COLOR_OP_SHIFT 20
67#define PROGRAM_XFERMODE_FRAMEBUFFER_SHIFT 14
68
69#define PROGRAM_BITMAP_WRAPS_SHIFT 9
70#define PROGRAM_BITMAP_WRAPT_SHIFT 11
71
Chris Craik6d29c8d2013-05-08 18:35:44 -070072#define PROGRAM_GRADIENT_TYPE_SHIFT 33 // 2 bits for gradient type
Romain Guyf3a910b42011-12-12 20:35:21 -080073#define PROGRAM_MODULATE_SHIFT 35
74
Chris Craik91a8c7c2014-08-12 14:31:35 -070075#define PROGRAM_HAS_VERTEX_ALPHA_SHIFT 36
76#define PROGRAM_USE_SHADOW_ALPHA_INTERP_SHIFT 37
Romain Guyf3a910b42011-12-12 20:35:21 -080077
Chris Craikbf759452014-08-11 16:00:44 -070078#define PROGRAM_HAS_EXTERNAL_TEXTURE_SHIFT 38
79#define PROGRAM_HAS_TEXTURE_TRANSFORM_SHIFT 39
Romain Guyf3a910b42011-12-12 20:35:21 -080080
Chris Craik11718bc2015-09-22 11:50:13 -070081#define PROGRAM_IS_SIMPLE_GRADIENT 40
Romain Guyf3a910b42011-12-12 20:35:21 -080082
Chris Craik11718bc2015-09-22 11:50:13 -070083#define PROGRAM_HAS_COLORS 41
Romain Guy41210632012-07-16 17:04:24 -070084
Chris Craik11718bc2015-09-22 11:50:13 -070085#define PROGRAM_HAS_DEBUG_HIGHLIGHT 42
86#define PROGRAM_HAS_ROUND_RECT_CLIP 43
Romain Guy3ff0bfd2013-02-25 14:15:37 -080087
Romain Guy253f2c22016-09-28 17:34:42 -070088#define PROGRAM_HAS_GAMMA_CORRECTION 44
89
Romain Guyf3a910b42011-12-12 20:35:21 -080090///////////////////////////////////////////////////////////////////////////////
91// Types
92///////////////////////////////////////////////////////////////////////////////
93
94typedef uint64_t programid;
95
96///////////////////////////////////////////////////////////////////////////////
97// Program description
98///////////////////////////////////////////////////////////////////////////////
99
100/**
101 * Describe the features required for a given program. The features
102 * determine the generation of both the vertex and fragment shaders.
103 * A ProgramDescription must be used in conjunction with a ProgramCache.
104 */
105struct ProgramDescription {
Chris Craikb9ce116d2015-08-20 15:14:06 -0700106 enum class ColorFilterMode {
107 None = 0,
108 Matrix,
109 Blend
Romain Guyf3a910b42011-12-12 20:35:21 -0800110 };
111
112 enum Gradient {
Romain Guy42e1e0d2012-07-30 14:47:51 -0700113 kGradientLinear = 0,
Romain Guyf3a910b42011-12-12 20:35:21 -0800114 kGradientCircular,
115 kGradientSweep
116 };
117
118 ProgramDescription() {
119 reset();
120 }
121
122 // Texturing
123 bool hasTexture;
124 bool hasAlpha8Texture;
125 bool hasExternalTexture;
126 bool hasTextureTransform;
127
Romain Guyff316ec2013-02-13 18:39:43 -0800128 // Color attribute
129 bool hasColors;
130
Romain Guyf3a910b42011-12-12 20:35:21 -0800131 // Modulate, this should only be set when setColor() return true
132 bool modulate;
133
134 // Shaders
135 bool hasBitmap;
sergeyv554ffeb2016-11-15 18:01:21 -0800136 bool useShaderBasedWrap;
Romain Guyf3a910b42011-12-12 20:35:21 -0800137
Chris Craik91a8c7c2014-08-12 14:31:35 -0700138 bool hasVertexAlpha;
139 bool useShadowAlphaInterp;
Romain Guyf3a910b42011-12-12 20:35:21 -0800140
141 bool hasGradient;
142 Gradient gradientType;
Romain Guy42e1e0d2012-07-30 14:47:51 -0700143 bool isSimpleGradient;
Romain Guyf3a910b42011-12-12 20:35:21 -0800144
Mike Reedc2f31df2016-10-28 17:21:45 -0400145 SkBlendMode shadersMode;
Romain Guyf3a910b42011-12-12 20:35:21 -0800146
147 bool isBitmapFirst;
148 GLenum bitmapWrapS;
149 GLenum bitmapWrapT;
150
151 // Color operations
Chris Craik117bdbc2015-02-05 10:12:38 -0800152 ColorFilterMode colorOp;
Mike Reedc2f31df2016-10-28 17:21:45 -0400153 SkBlendMode colorMode;
Romain Guyf3a910b42011-12-12 20:35:21 -0800154
155 // Framebuffer blending (requires Extensions.hasFramebufferFetch())
Mike Reedc2f31df2016-10-28 17:21:45 -0400156 // Ignored for all values < SkBlendMode::kPlus
157 SkBlendMode framebufferMode;
Romain Guyf3a910b42011-12-12 20:35:21 -0800158 bool swapSrcDst;
159
Romain Guy3ff0bfd2013-02-25 14:15:37 -0800160 bool hasDebugHighlight;
Chris Craikdeeda3d2014-05-05 19:09:33 -0700161 bool hasRoundRectClip;
Romain Guy3ff0bfd2013-02-25 14:15:37 -0800162
Romain Guy253f2c22016-09-28 17:34:42 -0700163 bool hasGammaCorrection;
164
Romain Guyf3a910b42011-12-12 20:35:21 -0800165 /**
166 * Resets this description. All fields are reset back to the default
167 * values they hold after building a new instance.
168 */
169 void reset() {
170 hasTexture = false;
171 hasAlpha8Texture = false;
172 hasExternalTexture = false;
173 hasTextureTransform = false;
174
Romain Guyff316ec2013-02-13 18:39:43 -0800175 hasColors = false;
176
Chris Craik91a8c7c2014-08-12 14:31:35 -0700177 hasVertexAlpha = false;
178 useShadowAlphaInterp = false;
Romain Guyf3a910b42011-12-12 20:35:21 -0800179
180 modulate = false;
181
182 hasBitmap = false;
sergeyv554ffeb2016-11-15 18:01:21 -0800183 useShaderBasedWrap = false;
Romain Guyf3a910b42011-12-12 20:35:21 -0800184
185 hasGradient = false;
186 gradientType = kGradientLinear;
Romain Guy42e1e0d2012-07-30 14:47:51 -0700187 isSimpleGradient = false;
Romain Guyf3a910b42011-12-12 20:35:21 -0800188
Mike Reedc2f31df2016-10-28 17:21:45 -0400189 shadersMode = SkBlendMode::kClear;
Romain Guyf3a910b42011-12-12 20:35:21 -0800190
191 isBitmapFirst = false;
192 bitmapWrapS = GL_CLAMP_TO_EDGE;
193 bitmapWrapT = GL_CLAMP_TO_EDGE;
194
Chris Craikb9ce116d2015-08-20 15:14:06 -0700195 colorOp = ColorFilterMode::None;
Mike Reedc2f31df2016-10-28 17:21:45 -0400196 colorMode = SkBlendMode::kClear;
Romain Guyf3a910b42011-12-12 20:35:21 -0800197
Mike Reedc2f31df2016-10-28 17:21:45 -0400198 framebufferMode = SkBlendMode::kClear;
Romain Guyf3a910b42011-12-12 20:35:21 -0800199 swapSrcDst = false;
200
Romain Guy3ff0bfd2013-02-25 14:15:37 -0800201 hasDebugHighlight = false;
Chris Craikdeeda3d2014-05-05 19:09:33 -0700202 hasRoundRectClip = false;
Romain Guy253f2c22016-09-28 17:34:42 -0700203
204 hasGammaCorrection = false;
Romain Guyf3a910b42011-12-12 20:35:21 -0800205 }
206
207 /**
208 * Indicates, for a given color, whether color modulation is required in
209 * the fragment shader. When this method returns true, the program should
210 * be provided with a modulation color.
211 */
Chris Craike63f7c622013-10-17 10:30:55 -0700212 bool setColorModulate(const float a) {
Romain Guya938f562012-09-13 20:31:08 -0700213 modulate = a < COLOR_COMPONENT_THRESHOLD;
Romain Guyf3a910b42011-12-12 20:35:21 -0800214 return modulate;
215 }
216
217 /**
218 * Indicates, for a given color, whether color modulation is required in
219 * the fragment shader. When this method returns true, the program should
220 * be provided with a modulation color.
221 */
Chris Craike63f7c622013-10-17 10:30:55 -0700222 bool setAlpha8ColorModulate(const float r, const float g, const float b, const float a) {
Romain Guyf3a910b42011-12-12 20:35:21 -0800223 modulate = a < COLOR_COMPONENT_THRESHOLD || r > COLOR_COMPONENT_INV_THRESHOLD ||
224 g > COLOR_COMPONENT_INV_THRESHOLD || b > COLOR_COMPONENT_INV_THRESHOLD;
225 return modulate;
226 }
227
228 /**
229 * Computes the unique key identifying this program.
230 */
231 programid key() const {
232 programid key = 0;
233 if (hasTexture) key |= PROGRAM_KEY_TEXTURE;
234 if (hasAlpha8Texture) key |= PROGRAM_KEY_A8_TEXTURE;
235 if (hasBitmap) {
236 key |= PROGRAM_KEY_BITMAP;
sergeyv554ffeb2016-11-15 18:01:21 -0800237 if (useShaderBasedWrap) {
Romain Guyf3a910b42011-12-12 20:35:21 -0800238 key |= PROGRAM_KEY_BITMAP_NPOT;
239 key |= getEnumForWrap(bitmapWrapS) << PROGRAM_BITMAP_WRAPS_SHIFT;
240 key |= getEnumForWrap(bitmapWrapT) << PROGRAM_BITMAP_WRAPT_SHIFT;
241 }
242 }
243 if (hasGradient) key |= PROGRAM_KEY_GRADIENT;
244 key |= programid(gradientType) << PROGRAM_GRADIENT_TYPE_SHIFT;
245 if (isBitmapFirst) key |= PROGRAM_KEY_BITMAP_FIRST;
246 if (hasBitmap && hasGradient) {
Mike Reedc2f31df2016-10-28 17:21:45 -0400247 key |= ((int)shadersMode & PROGRAM_MAX_XFERMODE) << PROGRAM_XFERMODE_SHADER_SHIFT;
Romain Guyf3a910b42011-12-12 20:35:21 -0800248 }
249 switch (colorOp) {
Chris Craikb9ce116d2015-08-20 15:14:06 -0700250 case ColorFilterMode::Matrix:
Romain Guyf3a910b42011-12-12 20:35:21 -0800251 key |= PROGRAM_KEY_COLOR_MATRIX;
252 break;
Chris Craikb9ce116d2015-08-20 15:14:06 -0700253 case ColorFilterMode::Blend:
Romain Guyf3a910b42011-12-12 20:35:21 -0800254 key |= PROGRAM_KEY_COLOR_BLEND;
Mike Reedc2f31df2016-10-28 17:21:45 -0400255 key |= ((int)colorMode & PROGRAM_MAX_XFERMODE) << PROGRAM_XFERMODE_COLOR_OP_SHIFT;
Romain Guyf3a910b42011-12-12 20:35:21 -0800256 break;
Chris Craikb9ce116d2015-08-20 15:14:06 -0700257 case ColorFilterMode::None:
Romain Guyf3a910b42011-12-12 20:35:21 -0800258 break;
259 }
Mike Reedc2f31df2016-10-28 17:21:45 -0400260 key |= ((int)framebufferMode & PROGRAM_MAX_XFERMODE) << PROGRAM_XFERMODE_FRAMEBUFFER_SHIFT;
Romain Guyf3a910b42011-12-12 20:35:21 -0800261 if (swapSrcDst) key |= PROGRAM_KEY_SWAP_SRC_DST;
262 if (modulate) key |= programid(0x1) << PROGRAM_MODULATE_SHIFT;
Chris Craik91a8c7c2014-08-12 14:31:35 -0700263 if (hasVertexAlpha) key |= programid(0x1) << PROGRAM_HAS_VERTEX_ALPHA_SHIFT;
264 if (useShadowAlphaInterp) key |= programid(0x1) << PROGRAM_USE_SHADOW_ALPHA_INTERP_SHIFT;
Romain Guyf3a910b42011-12-12 20:35:21 -0800265 if (hasExternalTexture) key |= programid(0x1) << PROGRAM_HAS_EXTERNAL_TEXTURE_SHIFT;
266 if (hasTextureTransform) key |= programid(0x1) << PROGRAM_HAS_TEXTURE_TRANSFORM_SHIFT;
Romain Guy42e1e0d2012-07-30 14:47:51 -0700267 if (isSimpleGradient) key |= programid(0x1) << PROGRAM_IS_SIMPLE_GRADIENT;
Romain Guyff316ec2013-02-13 18:39:43 -0800268 if (hasColors) key |= programid(0x1) << PROGRAM_HAS_COLORS;
Romain Guy3ff0bfd2013-02-25 14:15:37 -0800269 if (hasDebugHighlight) key |= programid(0x1) << PROGRAM_HAS_DEBUG_HIGHLIGHT;
Chris Craikdeeda3d2014-05-05 19:09:33 -0700270 if (hasRoundRectClip) key |= programid(0x1) << PROGRAM_HAS_ROUND_RECT_CLIP;
Romain Guy253f2c22016-09-28 17:34:42 -0700271 if (hasGammaCorrection) key |= programid(0x1) << PROGRAM_HAS_GAMMA_CORRECTION;
Romain Guyf3a910b42011-12-12 20:35:21 -0800272 return key;
273 }
274
275 /**
276 * Logs the specified message followed by the key identifying this program.
277 */
278 void log(const char* message) const {
279#if DEBUG_PROGRAMS
280 programid k = key();
281 PROGRAM_LOGD("%s (key = 0x%.8x%.8x)", message, uint32_t(k >> 32),
282 uint32_t(k & 0xffffffff));
283#endif
284 }
285
286private:
Romain Guy41210632012-07-16 17:04:24 -0700287 static inline uint32_t getEnumForWrap(GLenum wrap) {
Romain Guyf3a910b42011-12-12 20:35:21 -0800288 switch (wrap) {
289 case GL_CLAMP_TO_EDGE:
290 return 0;
291 case GL_REPEAT:
292 return 1;
293 case GL_MIRRORED_REPEAT:
294 return 2;
295 }
296 return 0;
297 }
298
299}; // struct ProgramDescription
300
Romain Guy5cbbce52010-06-27 22:59:20 -0700301/**
302 * A program holds a vertex and a fragment shader. It offers several utility
303 * methods to query attributes and uniforms.
304 */
Romain Guy889f8d12010-07-29 14:37:42 -0700305class Program {
Romain Guy5cbbce52010-06-27 22:59:20 -0700306public:
Romain Guy3e263fa2011-12-12 16:47:48 -0800307 enum ShaderBindings {
308 kBindingPosition,
309 kBindingTexCoords
310 };
311
Romain Guy5cbbce52010-06-27 22:59:20 -0700312 /**
313 * Creates a new program with the specified vertex and fragment
314 * shaders sources.
315 */
Romain Guyf3a910b42011-12-12 20:35:21 -0800316 Program(const ProgramDescription& description, const char* vertex, const char* fragment);
Romain Guy6926c722010-07-12 20:20:03 -0700317 virtual ~Program();
Romain Guy5cbbce52010-06-27 22:59:20 -0700318
319 /**
320 * Binds this program to the GL context.
321 */
Romain Guy6926c722010-07-12 20:20:03 -0700322 virtual void use();
Romain Guy5cbbce52010-06-27 22:59:20 -0700323
Romain Guy260e1022010-07-12 14:41:06 -0700324 /**
325 * Marks this program as unused. This will not unbind
326 * the program from the GL context.
327 */
Romain Guy6926c722010-07-12 20:20:03 -0700328 virtual void remove();
Romain Guy260e1022010-07-12 14:41:06 -0700329
330 /**
Romain Guyac670c02010-07-27 17:39:27 -0700331 * Returns the OpenGL name of the specified attribute.
332 */
333 int getAttrib(const char* name);
334
335 /**
336 * Returns the OpenGL name of the specified uniform.
337 */
338 int getUniform(const char* name);
339
340 /**
Romain Guy260e1022010-07-12 14:41:06 -0700341 * Indicates whether this program is currently in use with
342 * the GL context.
343 */
344 inline bool isInUse() const {
345 return mUse;
346 }
347
Romain Guy889f8d12010-07-29 14:37:42 -0700348 /**
Romain Guy67f27952010-12-07 20:09:23 -0800349 * Indicates whether this program was correctly compiled and linked.
350 */
351 inline bool isInitialized() const {
352 return mInitialized;
353 }
354
355 /**
Romain Guy889f8d12010-07-29 14:37:42 -0700356 * Binds the program with the specified projection, modelView and
357 * transform matrices.
358 */
359 void set(const mat4& projectionMatrix, const mat4& modelViewMatrix,
Chet Haase8a5cc922011-04-26 07:28:09 -0700360 const mat4& transformMatrix, bool offset = false);
Romain Guy889f8d12010-07-29 14:37:42 -0700361
362 /**
Romain Guy707b2f72010-10-11 16:34:59 -0700363 * Sets the color associated with this shader.
364 */
Chris Craik0519c8102015-02-11 13:17:06 -0800365 void setColor(FloatColor color);
Romain Guy707b2f72010-10-11 16:34:59 -0700366
367 /**
Chris Craik6c15ffa2015-02-02 13:50:55 -0800368 * Name of the texCoords attribute if it exists (kBindingTexCoords), -1 otherwise.
Romain Guyf3a910b42011-12-12 20:35:21 -0800369 */
370 int texCoords;
371
372 /**
Romain Guy889f8d12010-07-29 14:37:42 -0700373 * Name of the transform uniform.
374 */
375 int transform;
376
Romain Guy39284b72012-09-26 16:39:40 -0700377 /**
378 * Name of the projection uniform.
379 */
380 int projection;
381
Romain Guy5cbbce52010-06-27 22:59:20 -0700382protected:
383 /**
384 * Adds an attribute with the specified name.
385 *
386 * @return The OpenGL name of the attribute.
387 */
388 int addAttrib(const char* name);
Romain Guy5cbbce52010-06-27 22:59:20 -0700389
390 /**
Romain Guy3e263fa2011-12-12 16:47:48 -0800391 * Binds the specified attribute name to the specified slot.
392 */
393 int bindAttrib(const char* name, ShaderBindings bindingSlot);
394
395 /**
Romain Guy5cbbce52010-06-27 22:59:20 -0700396 * Adds a uniform with the specified name.
397 *
398 * @return The OpenGL name of the uniform.
399 */
400 int addUniform(const char* name);
Romain Guy5cbbce52010-06-27 22:59:20 -0700401
402private:
403 /**
404 * Compiles the specified shader of the specified type.
405 *
406 * @return The name of the compiled shader.
407 */
408 GLuint buildShader(const char* source, GLenum type);
409
Romain Guy3e263fa2011-12-12 16:47:48 -0800410 // Name of the OpenGL program and shaders
Romain Guy05bbde72011-12-09 12:55:37 -0800411 GLuint mProgramId;
Romain Guy3e263fa2011-12-12 16:47:48 -0800412 GLuint mVertexShader;
413 GLuint mFragmentShader;
Romain Guy5cbbce52010-06-27 22:59:20 -0700414
415 // Keeps track of attributes and uniforms slots
Romain Guy05bbde72011-12-09 12:55:37 -0800416 KeyedVector<const char*, int> mAttributes;
417 KeyedVector<const char*, int> mUniforms;
Romain Guy260e1022010-07-12 14:41:06 -0700418
419 bool mUse;
Romain Guy67f27952010-12-07 20:09:23 -0800420 bool mInitialized;
Romain Guy05bbde72011-12-09 12:55:37 -0800421
Romain Guy3b748a42013-04-17 18:54:38 -0700422 // Uniforms caching
Romain Guy05bbde72011-12-09 12:55:37 -0800423 bool mHasColorUniform;
424 int mColorUniform;
Romain Guy2d4fd362011-12-13 22:00:19 -0800425
426 bool mHasSampler;
Romain Guy3b748a42013-04-17 18:54:38 -0700427
428 mat4 mProjection;
Chris Craikd04a6b12014-01-29 13:00:33 -0800429 bool mOffset;
Romain Guy5cbbce52010-06-27 22:59:20 -0700430}; // class Program
431
Romain Guy5cbbce52010-06-27 22:59:20 -0700432}; // namespace uirenderer
433}; // namespace android
434
Romain Guy5b3b3522010-10-27 18:57:51 -0700435#endif // ANDROID_HWUI_PROGRAM_H