aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pipe/SkGPipeRead.cpp
diff options
context:
space:
mode:
authorGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-20 17:39:51 +0000
committerGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-20 17:39:51 +0000
commit5a2e879ef8a3720ac3f06fbc13dcdaeb179f30c3 (patch)
tree2dad3da28e5b35ac7cfb2686faf180e8feafa4a4 /src/pipe/SkGPipeRead.cpp
parent90b7e386cab251db78152f18adfd54e019b8dc10 (diff)
Fixes for drawing through an SkGPipe.
Implement SkGPipeCanvas::drawBitmap. Fix a bug where needOpBytes did not necessarily provide as many bytes as requested. Fix a bug where needOpBytes would wipe old data without calling notify. Register SkEmbossMaskFilter so it can be flattened. Override drawBitmapNine (currently unimplemented) so an SkGPipeCanvas does not call its base class' method (which would fail). Review URL: https://codereview.appspot.com/6071045 git-svn-id: http://skia.googlecode.com/svn/trunk@3741 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pipe/SkGPipeRead.cpp')
-rw-r--r--src/pipe/SkGPipeRead.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp
index 0382c0a6da..7642f35689 100644
--- a/src/pipe/SkGPipeRead.cpp
+++ b/src/pipe/SkGPipeRead.cpp
@@ -329,7 +329,14 @@ static void drawTextOnPath_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op3
static void drawBitmap_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
SkGPipeState* state) {
- UNIMPLEMENTED
+ uint32_t bitmapSize = reader->readU32();
+ SkOrderedReadBuffer readBuffer(reader->skip(bitmapSize), bitmapSize);
+ SkBitmap bm;
+ bm.unflatten(readBuffer);
+ bool hasPaint = reader->readBool();
+ SkScalar left = reader->readScalar();
+ SkScalar top = reader->readScalar();
+ canvas->drawBitmap(bm, left, top, hasPaint ? &state->paint() : NULL);
}
static void drawBitmapMatrix_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,