2014-08-18 10:17:16 +00:00
|
|
|
#ifndef CANVASPIXELSHADER_H
|
|
|
|
#define CANVASPIXELSHADER_H
|
|
|
|
|
|
|
|
#include "software_global.h"
|
|
|
|
|
|
|
|
#include "ParallelWorker.h"
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace software {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Parallel worker that can work on canvas portion to resolve pixel colors.
|
|
|
|
*
|
|
|
|
* This is used after the rasterization phase to compute pixel colors from the fragments stored in them.
|
|
|
|
*
|
|
|
|
* This worker will be set to work on a given chunk of a canvas portion.
|
|
|
|
*/
|
|
|
|
class CanvasPixelShader: public ParallelWorker
|
|
|
|
{
|
|
|
|
public:
|
2015-08-23 18:22:37 +00:00
|
|
|
CanvasPixelShader(const SoftwareCanvasRenderer &renderer, CanvasPortion *portion, RenderProgress *progress, int chunk_size, int sub_chunk_size, int chunks_x, int chunks_y);
|
2014-08-18 10:17:16 +00:00
|
|
|
|
2014-08-19 09:44:54 +00:00
|
|
|
virtual void processParallelUnit(int unit) override;
|
2014-08-18 10:17:16 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
const SoftwareCanvasRenderer &renderer;
|
|
|
|
CanvasPortion *portion;
|
2015-08-23 18:22:37 +00:00
|
|
|
RenderProgress *progress;
|
2014-08-18 10:17:16 +00:00
|
|
|
int chunk_size;
|
2014-08-18 14:04:46 +00:00
|
|
|
int sub_chunk_size;
|
2014-08-18 10:17:16 +00:00
|
|
|
int chunks_x;
|
|
|
|
int chunks_y;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // CANVASPIXELSHADER_H
|