MCPcopy Create free account
hub / github.com/MyGUI/mygui / validate

Method validate

MyGUIEngine/src/MyGUI_Canvas.cpp:131–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129 }
130
131 void Canvas::validate(int& _width, int& _height, TextureUsage& _usage, PixelFormat& _format) const
132 {
133 _width = std::max(1, _width);
134 _height = std::max(1, _height);
135
136 _width = Bitwise::firstPO2From(_width);
137 _height = Bitwise::firstPO2From(_height);
138
139 // restore usage and format
140 if (mTexture != nullptr)
141 {
142 if (_usage == getDefaultTextureUsage())
143 _usage = mTexture->getUsage();
144
145 if (_format == getDefaultTextureFormat())
146 _format = mTexture->getFormat();
147 }
148 }
149
150 void Canvas::destroyTexture()
151 {

Callers

nothing calls this directly

Calls 4

maxFunction · 0.85
firstPO2FromFunction · 0.85
getUsageMethod · 0.45
getFormatMethod · 0.45

Tested by

no test coverage detected