Skip to content

Commit

Permalink
override drawImage
Browse files Browse the repository at this point in the history
BUG=

Review URL: https://codereview.chromium.org/1126073002

Cr-Commit-Position: refs/heads/master@{#328530}
  • Loading branch information
reed authored and Commit bot committed May 6, 2015
1 parent 19b8603 commit a2969a3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
23 changes: 23 additions & 0 deletions skia/ext/analysis_canvas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,29 @@ void AnalysisCanvas::onDrawBitmapNine(const SkBitmap& bitmap,
++draw_op_count_;
}

void AnalysisCanvas::onDrawImage(const SkImage*,
SkScalar left,
SkScalar top,
const SkPaint*) {
is_solid_color_ = false;
is_transparent_ = false;
++draw_op_count_;
}

void AnalysisCanvas::onDrawImageRect(const SkImage*,
const SkRect* src,
const SkRect& dst,
const SkPaint* paint) {
// Call drawRect to determine transparency,
// but reset solid color to false.
SkPaint tmpPaint;
if (!paint)
paint = &tmpPaint;
drawRect(dst, *paint);
is_solid_color_ = false;
++draw_op_count_;
}

void AnalysisCanvas::onDrawSprite(const SkBitmap& bitmap,
int left,
int top,
Expand Down
8 changes: 8 additions & 0 deletions skia/ext/analysis_canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ class SK_API AnalysisCanvas : public SkCanvas, public SkDrawPictureCallback {
const SkIRect& center,
const SkRect& dst,
const SkPaint* paint = NULL) override;
void onDrawImage(const SkImage*,
SkScalar left,
SkScalar top,
const SkPaint* paint = NULL) override;
void onDrawImageRect(const SkImage*,
const SkRect* src,
const SkRect& dst,
const SkPaint* paint) override;
void onDrawSprite(const SkBitmap&,
int left,
int top,
Expand Down

0 comments on commit a2969a3

Please sign in to comment.