2016-07-12 17:40:45 +00:00
|
|
|
#pragma once
|
2014-08-18 10:17:16 +00:00
|
|
|
|
|
|
|
#include "software_global.h"
|
|
|
|
|
|
|
|
#include "ParallelWorker.h"
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace software {
|
|
|
|
|
|
|
|
/**
|
2016-01-03 18:21:23 +00:00
|
|
|
* Parallel worker that can work on canvas portion to resolve pixel colors.
|
2014-08-18 10:17:16 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2015-11-09 21:30:46 +00:00
|
|
|
class CanvasPixelShader : public ParallelWorker {
|
|
|
|
public:
|
|
|
|
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
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
private:
|
2014-08-18 10:17:16 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|