summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authorreed <reed@google.com>2015-07-15 21:03:12 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-16 04:03:51 +0000
commite33f25f7595737fd837b14fd11db75a409ee9af2 (patch)
tree8751bf1da60e00e5c2828db82936c731a8cfaa51 /skia
parentea952493d8ecbed6b05a3532bf9469ab536ea62f (diff)
downloadchromium_src-e33f25f7595737fd837b14fd11db75a409ee9af2.zip
chromium_src-e33f25f7595737fd837b14fd11db75a409ee9af2.tar.gz
chromium_src-e33f25f7595737fd837b14fd11db75a409ee9af2.tar.bz2
transition to new Constraints for drawBitmap/ImageRect
will need https://codereview.chromium.org/1233333002/# to land first BUG= Review URL: https://codereview.chromium.org/1241923004 Cr-Commit-Position: refs/heads/master@{#338984}
Diffstat (limited to 'skia')
-rw-r--r--skia/config/SkUserConfig.h4
-rw-r--r--skia/ext/analysis_canvas.cc5
-rw-r--r--skia/ext/analysis_canvas.h9
-rw-r--r--skia/ext/benchmarking_canvas.cc9
-rw-r--r--skia/ext/benchmarking_canvas.h4
-rw-r--r--skia/ext/pixel_ref_utils.cc2
6 files changed, 16 insertions, 17 deletions
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h
index d2bd2f7..96f457e 100644
--- a/skia/config/SkUserConfig.h
+++ b/skia/config/SkUserConfig.h
@@ -253,10 +253,6 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
# define SK_IGNORE_ETC1_SUPPORT
#endif
-#ifndef SK_SUPPORT_LEGACY_ONDRAWIMAGERECT
-# define SK_SUPPORT_LEGACY_ONDRAWIMAGERECT
-#endif
-
#ifndef SK_IGNORE_GPU_DITHER
# define SK_IGNORE_GPU_DITHER
#endif
diff --git a/skia/ext/analysis_canvas.cc b/skia/ext/analysis_canvas.cc
index 102c63e..b4482aa 100644
--- a/skia/ext/analysis_canvas.cc
+++ b/skia/ext/analysis_canvas.cc
@@ -194,7 +194,7 @@ void AnalysisCanvas::onDrawBitmapRect(const SkBitmap&,
const SkRect* src,
const SkRect& dst,
const SkPaint* paint,
- DrawBitmapRectFlags flags) {
+ SrcRectConstraint) {
// Call drawRect to determine transparency,
// but reset solid color to false.
SkPaint tmpPaint;
@@ -226,7 +226,8 @@ void AnalysisCanvas::onDrawImage(const SkImage*,
void AnalysisCanvas::onDrawImageRect(const SkImage*,
const SkRect* src,
const SkRect& dst,
- const SkPaint* paint) {
+ const SkPaint* paint,
+ SrcRectConstraint) {
// Call drawRect to determine transparency,
// but reset solid color to false.
SkPaint tmpPaint;
diff --git a/skia/ext/analysis_canvas.h b/skia/ext/analysis_canvas.h
index 5a59647..4c53e3d 100644
--- a/skia/ext/analysis_canvas.h
+++ b/skia/ext/analysis_canvas.h
@@ -47,7 +47,7 @@ class SK_API AnalysisCanvas : public SkCanvas, public SkPicture::AbortCallback {
const SkRect* src,
const SkRect& dst,
const SkPaint* paint,
- DrawBitmapRectFlags flags) override;
+ SrcRectConstraint) override;
void onDrawBitmapNine(const SkBitmap& bitmap,
const SkIRect& center,
const SkRect& dst,
@@ -57,9 +57,10 @@ class SK_API AnalysisCanvas : public SkCanvas, public SkPicture::AbortCallback {
SkScalar top,
const SkPaint* paint = NULL) override;
void onDrawImageRect(const SkImage*,
- const SkRect* src,
- const SkRect& dst,
- const SkPaint* paint) override;
+ const SkRect* src,
+ const SkRect& dst,
+ const SkPaint* paint,
+ SrcRectConstraint) override;
void onDrawSprite(const SkBitmap&,
int left,
int top,
diff --git a/skia/ext/benchmarking_canvas.cc b/skia/ext/benchmarking_canvas.cc
index 904d6bd..924ce28 100644
--- a/skia/ext/benchmarking_canvas.cc
+++ b/skia/ext/benchmarking_canvas.cc
@@ -702,14 +702,14 @@ void BenchmarkingCanvas::onDrawBitmapRect(const SkBitmap& bitmap,
const SkRect* src,
const SkRect& dst,
const SkPaint* paint,
- DrawBitmapRectFlags flags) {
+ SrcRectConstraint constraint) {
AutoOp op(this, "DrawBitmapRect", paint);
op.addParam("bitmap", AsValue(bitmap));
if (src)
op.addParam("src", AsValue(*src));
op.addParam("dst", AsValue(dst));
- INHERITED::onDrawBitmapRect(bitmap, src, dst, op.paint(), flags);
+ INHERITED::onDrawBitmapRect(bitmap, src, dst, op.paint(), constraint);
}
void BenchmarkingCanvas::onDrawImage(const SkImage* image,
@@ -726,7 +726,8 @@ void BenchmarkingCanvas::onDrawImage(const SkImage* image,
}
void BenchmarkingCanvas::onDrawImageRect(const SkImage* image, const SkRect* src,
- const SkRect& dst, const SkPaint* paint) {
+ const SkRect& dst, const SkPaint* paint,
+ SrcRectConstraint constraint) {
DCHECK(image);
AutoOp op(this, "DrawImageRect", paint);
op.addParam("image", AsValue(*image));
@@ -734,7 +735,7 @@ void BenchmarkingCanvas::onDrawImageRect(const SkImage* image, const SkRect* src
op.addParam("src", AsValue(*src));
op.addParam("dst", AsValue(dst));
- INHERITED::onDrawImageRect(image, src, dst, op.paint());
+ INHERITED::onDrawImageRect(image, src, dst, op.paint(), constraint);
}
void BenchmarkingCanvas::onDrawBitmapNine(const SkBitmap& bitmap,
diff --git a/skia/ext/benchmarking_canvas.h b/skia/ext/benchmarking_canvas.h
index a33c42d..8fbbae4 100644
--- a/skia/ext/benchmarking_canvas.h
+++ b/skia/ext/benchmarking_canvas.h
@@ -60,10 +60,10 @@ protected:
void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) override;
void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst,
- const SkPaint*, DrawBitmapRectFlags flags) override;
+ const SkPaint*, SrcRectConstraint) override;
void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) override;
void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
- const SkPaint*) override;
+ const SkPaint*, SrcRectConstraint) override;
void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
const SkPaint*) override;
void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) override;
diff --git a/skia/ext/pixel_ref_utils.cc b/skia/ext/pixel_ref_utils.cc
index 86e2c09..8b5f1dc 100644
--- a/skia/ext/pixel_ref_utils.cc
+++ b/skia/ext/pixel_ref_utils.cc
@@ -154,7 +154,7 @@ class GatherPixelRefDevice : public SkBitmapDevice {
const SkRect* src_or_null,
const SkRect& dst,
const SkPaint& paint,
- SkCanvas::DrawBitmapRectFlags flags) override {
+ SkCanvas::SrcRectConstraint) override {
SkRect bitmap_rect = SkRect::MakeWH(bitmap.width(), bitmap.height());
SkMatrix matrix;
matrix.setRectToRect(bitmap_rect, dst, SkMatrix::kFill_ScaleToFit);