Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: src/pipe/utils/SamplePipeControllers.h

Issue 1568883003: remove SkGPipe (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | src/pipe/utils/SamplePipeControllers.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pipe/utils/SamplePipeControllers.h
diff --git a/src/pipe/utils/SamplePipeControllers.h b/src/pipe/utils/SamplePipeControllers.h
deleted file mode 100644
index b3f057fa8c5498051744a98caac54296512beb6d..0000000000000000000000000000000000000000
--- a/src/pipe/utils/SamplePipeControllers.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkBitmap.h"
-#include "SkChunkAlloc.h"
-#include "SkGPipe.h"
-#include "SkPicture.h"
-#include "SkTDArray.h"
-
-class SkCanvas;
-class SkMatrix;
-
-class PipeController : public SkGPipeController {
-public:
- PipeController(SkCanvas* target, SkPicture::InstallPixelRefProc proc = nullptr);
- virtual ~PipeController();
- void* requestBlock(size_t minRequest, size_t* actual) override;
- void notifyWritten(size_t bytes) override;
-protected:
- const void* getData() { return (const char*) fBlock + fBytesWritten; }
- SkGPipeReader fReader;
-private:
- void* fBlock;
- size_t fBlockSize;
- size_t fBytesWritten;
- SkGPipeReader::Status fStatus;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
-class TiledPipeController : public PipeController {
-public:
- TiledPipeController(const SkBitmap&, SkPicture::InstallPixelRefProc proc = nullptr,
- const SkMatrix* initialMatrix = nullptr);
- virtual ~TiledPipeController() {};
- void notifyWritten(size_t bytes) override;
- int numberOfReaders() const override { return NumberOfTiles; }
-private:
- enum {
- NumberOfTiles = 10
- };
- SkGPipeReader fReaders[NumberOfTiles - 1];
- SkBitmap fBitmaps[NumberOfTiles];
- typedef PipeController INHERITED;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
-/**
- * Borrowed (and modified) from SkDeferredCanvas.cpp::DeferredPipeController.
- * Allows playing back from multiple threads, but does not do the threading itself.
- */
-class ThreadSafePipeController : public SkGPipeController {
-public:
- ThreadSafePipeController(int numberOfReaders);
- void* requestBlock(size_t minRequest, size_t* actual) override;
- void notifyWritten(size_t bytes) override;
- int numberOfReaders() const override { return fNumberOfReaders; }
-
- /**
- * Play the stored drawing commands to the specified canvas. If SkGPipeWriter::startRecording
- * used the flag SkGPipeWriter::kSimultaneousReaders_Flag, this can be called from different
- * threads simultaneously.
- */
- void draw(SkCanvas*);
-private:
- enum {
- kMinBlockSize = 4096
- };
- struct PipeBlock {
- PipeBlock(void* block, size_t bytes) { fBlock = block, fBytes = bytes; }
- // Stream of draw commands written by the SkGPipeWriter. Allocated by fAllocator, which will
- // handle freeing it.
- void* fBlock;
- // Number of bytes that were written to fBlock.
- size_t fBytes;
- };
- void* fBlock;
- size_t fBytesWritten;
- SkChunkAlloc fAllocator;
- SkTDArray<PipeBlock> fBlockList;
- int fNumberOfReaders;
-};
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | src/pipe/utils/SamplePipeControllers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698