aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pipe/utils/SamplePipeControllers.cpp
diff options
context:
space:
mode:
authorGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-08 15:35:03 +0000
committerGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-08 15:35:03 +0000
commitb073d920c90bc95f6c216327acd321a4fc809bfa (patch)
tree2d6c8b06736e0b0754f27d4235c18f39e3f6a5bf /src/pipe/utils/SamplePipeControllers.cpp
parent56f2244dca1d0bc187370c35e9a74d5b73d1e2ca (diff)
Add a tiled pipe mode to SampleApp.
Using the "Pipe" checkbox in SamleApp, you can now toggle amongst three states: no pipe, a normal pipe (or others depending on #defines), and a tiled pipe. You can also use shift + p to toggle. Review URL: https://codereview.appspot.com/6303055 git-svn-id: http://skia.googlecode.com/svn/trunk@4213 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pipe/utils/SamplePipeControllers.cpp')
-rw-r--r--src/pipe/utils/SamplePipeControllers.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pipe/utils/SamplePipeControllers.cpp b/src/pipe/utils/SamplePipeControllers.cpp
index 487a2b8356..740d1b835f 100644
--- a/src/pipe/utils/SamplePipeControllers.cpp
+++ b/src/pipe/utils/SamplePipeControllers.cpp
@@ -6,9 +6,11 @@
*/
#include "SamplePipeControllers.h"
+
#include "SkCanvas.h"
#include "SkDevice.h"
#include "SkGPipe.h"
+#include "SkMatrix.h"
PipeController::PipeController(SkCanvas* target)
:fReader(target) {
@@ -37,7 +39,8 @@ void PipeController::notifyWritten(size_t bytes) {
////////////////////////////////////////////////////////////////////////////////
-TiledPipeController::TiledPipeController(const SkBitmap& bitmap)
+TiledPipeController::TiledPipeController(const SkBitmap& bitmap,
+ const SkMatrix* initial)
: INHERITED(NULL) {
int32_t top = 0;
int32_t bottom;
@@ -53,6 +56,9 @@ TiledPipeController::TiledPipeController(const SkBitmap& bitmap)
SkDevice* device = new SkDevice(fBitmaps[i]);
SkCanvas* canvas = new SkCanvas(device);
device->unref();
+ if (initial != NULL) {
+ canvas->setMatrix(*initial);
+ }
canvas->translate(SkIntToScalar(-rect.left()),
SkIntToScalar(-rect.top()));
if (0 == i) {