diff options
author | 2018-12-05 17:55:55 +0000 | |
---|---|---|
committer | 2018-12-05 17:55:55 +0000 | |
commit | 49a945a212ff6ecda29030ceb3aa614e52812cd2 (patch) | |
tree | a805155df4dba5d456925a9911e434bb0baaee2c | |
parent | 07ee215a85de1053e71e3df94feaf502aea676c6 (diff) | |
parent | 1441bf7e254e0f2c4f21275b44f318f77868c2ba (diff) |
Merge "Add default values to {Display,Layer}Settings fields"
-rw-r--r-- | libs/renderengine/include/renderengine/DisplaySettings.h | 14 | ||||
-rw-r--r-- | libs/renderengine/include/renderengine/LayerSettings.h | 28 |
2 files changed, 21 insertions, 21 deletions
diff --git a/libs/renderengine/include/renderengine/DisplaySettings.h b/libs/renderengine/include/renderengine/DisplaySettings.h index 5941cdfef0..aa4e3196c1 100644 --- a/libs/renderengine/include/renderengine/DisplaySettings.h +++ b/libs/renderengine/include/renderengine/DisplaySettings.h @@ -29,32 +29,32 @@ namespace renderengine { struct DisplaySettings { // Rectangle describing the physical display. We will project from the // logical clip onto this rectangle. - Rect physicalDisplay; + Rect physicalDisplay = Rect::INVALID_RECT; // Rectangle bounded by the x,y- clipping planes in the logical display, so // that the orthographic projection matrix can be computed. When // constructing this matrix, z-coordinate bound are assumed to be at z=0 and // z=1. - Rect clip; + Rect clip = Rect::INVALID_RECT; // Global transform to apply to all layers. - mat4 globalTransform; + mat4 globalTransform = mat4(); // Maximum luminance pulled from the display's HDR capabilities. - float maxLuminence; + float maxLuminence = 1.0f; // Output dataspace that will be populated if wide color gamut is used, or // DataSpace::UNKNOWN otherwise. - ui::Dataspace outputDataspace; + ui::Dataspace outputDataspace = ui::Dataspace::UNKNOWN; // Additional color transform to apply in linear space after transforming // to the output dataspace. - mat4 colorTransform; + mat4 colorTransform = mat4(); // Region that will be cleared to (0, 0, 0, 0) prior to rendering. // clearRegion will first be transformed by globalTransform so that it will // be in the same coordinate space as the rendered layers. - Region clearRegion; + Region clearRegion = Region::INVALID_REGION; }; } // namespace renderengine diff --git a/libs/renderengine/include/renderengine/LayerSettings.h b/libs/renderengine/include/renderengine/LayerSettings.h index facea214a9..38dee40b3a 100644 --- a/libs/renderengine/include/renderengine/LayerSettings.h +++ b/libs/renderengine/include/renderengine/LayerSettings.h @@ -34,58 +34,58 @@ struct Buffer { // Buffer containing the image that we will render. // If buffer == nullptr, then the rest of the fields in this struct will be // ignored. - sp<GraphicBuffer> buffer; + sp<GraphicBuffer> buffer = nullptr; // Texture identifier to bind the external texture to. // TODO(alecmouri): This is GL-specific...make the type backend-agnostic. - uint32_t textureName; + uint32_t textureName = 0; // Whether to use filtering when rendering the texture. - bool useTextureFiltering; + bool useTextureFiltering = false; // Transform matrix to apply to texture coordinates. - mat4 textureTransform; + mat4 textureTransform = mat4(); // Wheteher to use pre-multiplied alpha - bool usePremultipliedAlpha; + bool usePremultipliedAlpha = true; // HDR color-space setting for Y410. - bool isY410BT2020; + bool isY410BT2020 = false; }; // Metadata describing the layer geometry. struct Geometry { // Boundaries of the layer. - FloatRect boundaries; + FloatRect boundaries = FloatRect(); // Transform matrix to apply to mesh coordinates. - mat4 positionTransform; + mat4 positionTransform = mat4(); }; // Descriptor of the source pixels for this layer. struct PixelSource { // Source buffer - Buffer buffer; + Buffer buffer = Buffer(); // The solid color with which to fill the layer. // This should only be populated if we don't render from an application // buffer. - half3 solidColor; + half3 solidColor = half3(0.0f, 0.0f, 0.0f); }; // The settings that RenderEngine requires for correctly rendering a Layer. struct LayerSettings { // Geometry information - Geometry geometry; + Geometry geometry = Geometry(); // Source pixels for this layer. - PixelSource source; + PixelSource source = PixelSource(); // Alpha option to apply to the source pixels - half alpha; + half alpha = half(0.0); // Color space describing how the source pixels should be interpreted. - ui::Dataspace sourceDataspace; + ui::Dataspace sourceDataspace = ui::Dataspace::UNKNOWN; }; } // namespace renderengine |