Rename my DeferredPipeController to not conflict with the other.
Fixes build. Review URL: https://codereview.appspot.com/6506055 git-svn-id: http://skia.googlecode.com/svn/trunk@5372 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
58b4ead36c
commit
8e073ba2d6
@ -79,14 +79,14 @@ void TiledPipeController::notifyWritten(size_t bytes) {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DeferredPipeController::DeferredPipeController(int numberOfReaders)
|
||||
ThreadSafePipeController::ThreadSafePipeController(int numberOfReaders)
|
||||
: fAllocator(kMinBlockSize)
|
||||
, fNumberOfReaders(numberOfReaders) {
|
||||
fBlock = NULL;
|
||||
fBytesWritten = 0;
|
||||
}
|
||||
|
||||
void* DeferredPipeController::requestBlock(size_t minRequest, size_t *actual) {
|
||||
void* ThreadSafePipeController::requestBlock(size_t minRequest, size_t *actual) {
|
||||
if (fBlock) {
|
||||
// Save the previous block for later
|
||||
PipeBlock previousBloc(fBlock, fBytesWritten);
|
||||
@ -99,11 +99,11 @@ void* DeferredPipeController::requestBlock(size_t minRequest, size_t *actual) {
|
||||
return fBlock;
|
||||
}
|
||||
|
||||
void DeferredPipeController::notifyWritten(size_t bytes) {
|
||||
void ThreadSafePipeController::notifyWritten(size_t bytes) {
|
||||
fBytesWritten += bytes;
|
||||
}
|
||||
|
||||
void DeferredPipeController::playback(SkCanvas* target) {
|
||||
void ThreadSafePipeController::playback(SkCanvas* target) {
|
||||
SkGPipeReader reader(target);
|
||||
for (int currentBlock = 0; currentBlock < fBlockList.count(); currentBlock++ ) {
|
||||
reader.playback(fBlockList[currentBlock].fBlock, fBlockList[currentBlock].fBytes);
|
||||
|
@ -50,11 +50,11 @@ private:
|
||||
|
||||
/**
|
||||
* Borrowed (and modified) from SkDeferredCanvas.cpp::DeferredPipeController.
|
||||
* Allows playing back from multiple threads.
|
||||
* Allows playing back from multiple threads, but does not do the threading itself.
|
||||
*/
|
||||
class DeferredPipeController : public SkGPipeController {
|
||||
class ThreadSafePipeController : public SkGPipeController {
|
||||
public:
|
||||
DeferredPipeController(int numberOfReaders);
|
||||
ThreadSafePipeController(int numberOfReaders);
|
||||
virtual void* requestBlock(size_t minRequest, size_t* actual) SK_OVERRIDE;
|
||||
virtual void notifyWritten(size_t bytes) SK_OVERRIDE;
|
||||
virtual int numberOfReaders() const SK_OVERRIDE { return fNumberOfReaders; }
|
||||
|
@ -283,9 +283,9 @@ void TiledPictureRenderer::deleteTiles() {
|
||||
// Draw using Pipe
|
||||
|
||||
struct TileData {
|
||||
TileData(SkCanvas* canvas, DeferredPipeController* controller);
|
||||
TileData(SkCanvas* canvas, ThreadSafePipeController* controller);
|
||||
SkCanvas* fCanvas;
|
||||
DeferredPipeController* fController;
|
||||
ThreadSafePipeController* fController;
|
||||
SkThread fThread;
|
||||
};
|
||||
|
||||
@ -295,7 +295,7 @@ static void DrawTile(void* data) {
|
||||
tileData->fController->playback(tileData->fCanvas);
|
||||
}
|
||||
|
||||
TileData::TileData(SkCanvas* canvas, DeferredPipeController* controller)
|
||||
TileData::TileData(SkCanvas* canvas, ThreadSafePipeController* controller)
|
||||
: fCanvas(canvas)
|
||||
, fController(controller)
|
||||
, fThread(&DrawTile, static_cast<void*>(this)) {}
|
||||
@ -328,7 +328,7 @@ void TiledPictureRenderer::drawTiles() {
|
||||
if (fUsePipe) {
|
||||
// First, draw into a pipe controller
|
||||
SkGPipeWriter writer;
|
||||
DeferredPipeController controller(fTiles.count());
|
||||
ThreadSafePipeController controller(fTiles.count());
|
||||
SkCanvas* pipeCanvas = writer.startRecording(&controller,
|
||||
SkGPipeWriter::kSimultaneousReaders_Flag);
|
||||
pipeCanvas->drawPicture(*(fPicture));
|
||||
|
Loading…
Reference in New Issue
Block a user