FastUIDraw
painter_item_coverage_shader.hpp
Go to the documentation of this file.
1 /*!
2  * \file painter_item_coverage_shader.hpp
3  * \brief file painter_item_coverage_shader.hpp
4  *
5  * Copyright 2016 by Intel.
6  *
7  * Contact: kevin.rogovin@gmail.com
8  *
9  * This Source Code Form is subject to the
10  * terms of the Mozilla Public License, v. 2.0.
11  * If a copy of the MPL was not distributed with
12  * this file, You can obtain one at
13  * http://mozilla.org/MPL/2.0/.
14  *
15  * \author Kevin Rogovin <kevin.rogovin@gmail.com>
16  *
17  */
18 
19 
20 #ifndef FASTUIDRAW_PAINTER_ITEM_COVERAGE_SHADER_HPP
21 #define FASTUIDRAW_PAINTER_ITEM_COVERAGE_SHADER_HPP
23 
24 namespace fastuidraw
25 {
26 
27 /*!\addtogroup PainterShaders
28  * @{
29  */
30 
31  /*!
32  * \brief
33  * A PainterItemCoverageShader represents a shader to draw an item to a
34  * coverage buffer (see PainterSurface::deferred_coverage_buffer_type).
35  * Typically such a shader represents both a vertex and fragment shader.
36  */
38  {
39  public:
40  /*!
41  * Ctor for a PainterItemCoverageShader with no sub-shaders.
42  */
45  {}
46 
47  /*!
48  * Ctor for creating a PainterItemCoverageShader which has multiple
49  * sub-shaders. The purpose of sub-shaders is for the
50  * case where multiple shaders almost same code and those
51  * code differences can be realized by examining a sub-shader
52  * ID.
53  * \param num_sub_shaders number of sub-shaders
54  */
55  explicit
56  PainterItemCoverageShader(unsigned int num_sub_shaders):
57  PainterShader(num_sub_shaders)
58  {}
59 
60  /*!
61  * Ctor to create a PainterItemCoverageShader realized as a sub-shader
62  * of an existing PainterItemCoverageShader
63  * \param parent parent PainterItemCoverageShader that has sub-shaders
64  * \param sub_shader which sub-shader of the parent PainterItemCoverageShader
65  */
67  unsigned int sub_shader):
68  PainterShader(parent, sub_shader)
69  {}
70  };
71 
72 /*! @} */
73 }
74 
75 #endif
all classes and functions of FastUIDraw are in the namespace fastuidraw.
Definition: colorstop.hpp:28
A PainterShader encapsulates how to draw or blend.
A wrapper over a pointer to implement reference counting.
file painter_shader.hpp
uint32_t sub_shader(void) const
PainterItemCoverageShader(unsigned int num_sub_shaders)
A PainterItemCoverageShader represents a shader to draw an item to a coverage buffer (see PainterSurf...
const reference_counted_ptr< PainterShader > & parent(void) const
PainterItemCoverageShader(reference_counted_ptr< PainterItemCoverageShader > parent, unsigned int sub_shader)