| 374 | } |
| 375 | |
| 376 | LayerRadialGradient::LayerRadialGradient() |
| 377 | { |
| 378 | auto& pipelinePS = _customCommand.getPipelineDescriptor().programState; |
| 379 | auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::LAYER_RADIA_GRADIENT); |
| 380 | //!!! LayerRadialGradient private programState don't want affect by Node::_programState, so store at _customCommand |
| 381 | pipelinePS = new backend::ProgramState(program); |
| 382 | _mvpMatrixLocation = pipelinePS->getUniformLocation("u_MVPMatrix"); |
| 383 | _startColorLocation = pipelinePS->getUniformLocation("u_startColor"); |
| 384 | _endColorLocation = pipelinePS->getUniformLocation("u_endColor"); |
| 385 | _centerLocation = pipelinePS->getUniformLocation("u_center"); |
| 386 | _radiusLocation = pipelinePS->getUniformLocation("u_radius"); |
| 387 | _expandLocation = pipelinePS->getUniformLocation("u_expand"); |
| 388 | |
| 389 | _customCommand.createVertexBuffer(sizeof(_vertices[0]), sizeof(_vertices) / sizeof(_vertices[0]), |
| 390 | CustomCommand::BufferUsage::STATIC); |
| 391 | _customCommand.setDrawType(CustomCommand::DrawType::ARRAY); |
| 392 | _customCommand.setPrimitiveType(CustomCommand::PrimitiveType::TRIANGLE_STRIP); |
| 393 | } |
| 394 | |
| 395 | LayerRadialGradient::~LayerRadialGradient() |
| 396 | { |
nothing calls this directly
no test coverage detected