aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkCanvas.cpp
diff options
context:
space:
mode:
authorGravatar kkinnunen <kkinnunen@nvidia.com>2015-03-05 06:33:54 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-05 06:33:54 -0800
commita9baa652bb329b5a286e1638938f63433701efca (patch)
tree87c72a3ef72d9e5ba9024f44b9a788c0db3b23ca /src/core/SkCanvas.cpp
parentfa77eb1e51b9317ff993d1be504ada173b561e5f (diff)
Revert of Add image as a draw type that can be filtered (patchset #4 id:60001 of https://codereview.chromium.org/960783003/)
Reason for revert: Fails on mac for some reason. Also is a bit wrong, but this should not be reason for the failure.. Original issue's description: > Add image as a draw type that can be filtered > > Add image as a draw type that can be filtered. > > This is needed when SkImage is added as an object to be drawn so that > the draw is forwarded to SkBaseDevice. This would be used in making > filters use SkImages. > > BUG=skia:3388 > > Committed: https://skia.googlesource.com/skia/+/fa77eb1e51b9317ff993d1be504ada173b561e5f TBR=reed@google.com,bsalomon@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:3388 Review URL: https://codereview.chromium.org/980273002
Diffstat (limited to 'src/core/SkCanvas.cpp')
-rw-r--r--src/core/SkCanvas.cpp55
1 files changed, 3 insertions, 52 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index c0c6f8af3e..a47bd89c05 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1848,64 +1848,15 @@ void SkCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
LOOPER_END
}
-void SkCanvas::onDrawImage(const SkImage* image, SkScalar dx, SkScalar dy,
- const SkPaint* paint) {
+void SkCanvas::onDrawImage(const SkImage* image, SkScalar dx, SkScalar dy, const SkPaint* paint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawImage()");
-
- SkRect bounds = SkRect::MakeXYWH(dx, dy, image->width(), image->height());
- if (NULL == paint || paint->canComputeFastBounds()) {
- if (NULL != paint) {
- paint->computeFastBounds(bounds, &bounds);
- }
- if (this->quickReject(bounds)) {
- return;
- }
- }
-
- SkLazyPaint lazy;
- if (NULL == paint) {
- paint = lazy.init();
- }
-
- LOOPER_BEGIN(*paint, SkDrawFilter::kImage_Type, &bounds)
-
- while (iter.next()) {
- SkPaint p = looper.paint();
- p.setLooper(NULL);
- image->draw(this, dx, dy, &p);
- }
-
- LOOPER_END
+ image->draw(this, dx, dy, paint);
}
void SkCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
const SkPaint* paint) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawImageRect()");
- SkRect storage;
- const SkRect* bounds = &dst;
- if (NULL == paint || paint->canComputeFastBounds()) {
- if (NULL != paint) {
- bounds = &paint->computeFastBounds(dst, &storage);
- }
- if (this->quickReject(*bounds)) {
- return;
- }
- }
-
- SkLazyPaint lazy;
- if (NULL == paint) {
- paint = lazy.init();
- }
-
- LOOPER_BEGIN(*paint, SkDrawFilter::kImage_Type, bounds)
-
- while (iter.next()) {
- SkPaint p = looper.paint();
- p.setLooper(NULL);
- image->drawRect(this, src, dst, &p);
- }
-
- LOOPER_END
+ image->drawRect(this, src, dst, paint);
}
void SkCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, const SkPaint* paint) {