OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkDrawCommand.h" | 10 #include "SkDrawCommand.h" |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 361 |
362 void SkDrawBitmapRectCommand::execute(SkCanvas* canvas) const { | 362 void SkDrawBitmapRectCommand::execute(SkCanvas* canvas) const { |
363 canvas->drawBitmapRectToRect(fBitmap, this->srcRect(), fDst, fPaintPtr, fFla
gs); | 363 canvas->drawBitmapRectToRect(fBitmap, this->srcRect(), fDst, fPaintPtr, fFla
gs); |
364 } | 364 } |
365 | 365 |
366 bool SkDrawBitmapRectCommand::render(SkCanvas* canvas) const { | 366 bool SkDrawBitmapRectCommand::render(SkCanvas* canvas) const { |
367 render_bitmap(canvas, fBitmap, this->srcRect()); | 367 render_bitmap(canvas, fBitmap, this->srcRect()); |
368 return true; | 368 return true; |
369 } | 369 } |
370 | 370 |
371 SkDrawDataCommand::SkDrawDataCommand(const void* data, size_t length) | |
372 : INHERITED(DRAW_DATA) { | |
373 fData = new char[length]; | |
374 memcpy(fData, data, length); | |
375 fLength = length; | |
376 | |
377 // TODO: add display of actual data? | |
378 SkString* str = new SkString; | |
379 str->appendf("length: %d", (int) length); | |
380 fInfo.push(str); | |
381 } | |
382 | |
383 void SkDrawDataCommand::execute(SkCanvas* canvas) const { | |
384 canvas->drawData(fData, fLength); | |
385 } | |
386 | |
387 SkBeginCommentGroupCommand::SkBeginCommentGroupCommand(const char* description) | 371 SkBeginCommentGroupCommand::SkBeginCommentGroupCommand(const char* description) |
388 : INHERITED(BEGIN_COMMENT_GROUP) | 372 : INHERITED(BEGIN_COMMENT_GROUP) |
389 , fDescription(description) { | 373 , fDescription(description) { |
390 SkString* temp = new SkString; | 374 SkString* temp = new SkString; |
391 temp->appendf("Description: %s", description); | 375 temp->appendf("Description: %s", description); |
392 fInfo.push(temp); | 376 fInfo.push(temp); |
393 } | 377 } |
394 | 378 |
395 SkCommentCommand::SkCommentCommand(const char* kywd, const char* value) | 379 SkCommentCommand::SkCommentCommand(const char* kywd, const char* value) |
396 : INHERITED(COMMENT) | 380 : INHERITED(COMMENT) |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 fDy = dy; | 947 fDy = dy; |
964 | 948 |
965 fInfo.push(SkObjectParser::ScalarToString(dx, "SkScalar dx: ")); | 949 fInfo.push(SkObjectParser::ScalarToString(dx, "SkScalar dx: ")); |
966 fInfo.push(SkObjectParser::ScalarToString(dy, "SkScalar dy: ")); | 950 fInfo.push(SkObjectParser::ScalarToString(dy, "SkScalar dy: ")); |
967 } | 951 } |
968 | 952 |
969 void SkTranslateCommand::execute(SkCanvas* canvas) const { | 953 void SkTranslateCommand::execute(SkCanvas* canvas) const { |
970 canvas->translate(fDx, fDy); | 954 canvas->translate(fDx, fDy); |
971 } | 955 } |
972 | 956 |
OLD | NEW |