| 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 | { |
nothing calls this directly
no test coverage detected