aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkDevice.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-02-15 10:14:50 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-15 16:00:06 +0000
commit26e573c7ef17b96bb91c1e8dec86ca14efa6d0fb (patch)
tree7ac4171b6666fc61cb563e141604b9e46c3e27c6 /src/core/SkDevice.cpp
parent65e8a713f39d2f4acf8d1e89235b83ef6d790f97 (diff)
removed unused code around scaled generators
BUG=skia: Change-Id: I9e042cd9343e0f29032f84ee17b4b316214ec693 Reviewed-on: https://skia-review.googlesource.com/8403 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/core/SkDevice.cpp')
-rw-r--r--src/core/SkDevice.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 803cddd543..ad9df5b144 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -173,61 +173,8 @@ void SkBaseDevice::drawTextBlob(const SkDraw& draw, const SkTextBlob* blob, SkSc
}
}
-bool SkBaseDevice::drawExternallyScaledImage(const SkDraw& draw,
- const SkImage* image,
- const SkRect* src,
- const SkRect& dst,
- const SkPaint& paint,
- SkCanvas::SrcRectConstraint constraint) {
- SkImageCacherator* cacherator = as_IB(image)->peekCacherator();
- if (!cacherator) {
- return false;
- }
-
- SkTLazy<SkRect> tmpSrc(src);
- if (!tmpSrc.isValid()) {
- tmpSrc.init(SkRect::Make(image->bounds()));
- }
-
- SkMatrix m = *draw.fMatrix;
- m.preConcat(SkMatrix::MakeRectToRect(*tmpSrc.get(), dst, SkMatrix::kFill_ScaleToFit));
-
- // constrain src to our bounds
- if (!image->bounds().contains(*tmpSrc.get()) &&
- !tmpSrc.get()->intersect(SkRect::Make(image->bounds()))) {
- return false;
- }
-
- SkImageGenerator::ScaledImageRec rec;
- if (!cacherator->directAccessScaledImage(*tmpSrc.get(), m, paint.getFilterQuality(), &rec)) {
- return false;
- }
-
- SkBitmap bm;
- if (!bm.installPixels(rec.fPixmap.info(), const_cast<void*>(rec.fPixmap.addr()),
- rec.fPixmap.rowBytes(), rec.fPixmap.ctable(),
- rec.fReleaseProc, rec.fReleaseCtx)) {
- return false;
- }
-
- SkTCopyOnFirstWrite<SkPaint> adjustedPaint(paint);
- if (rec.fQuality != paint.getFilterQuality()) {
- adjustedPaint.writable()->setFilterQuality(rec.fQuality);
- }
-
- this->drawBitmapRect(draw, bm, &rec.fSrcRect, dst, *adjustedPaint, constraint);
-
- return true;
-}
void SkBaseDevice::drawImage(const SkDraw& draw, const SkImage* image, SkScalar x, SkScalar y,
const SkPaint& paint) {
- // Default impl : turns everything into raster bitmap
- if (this->drawExternallyScaledImage(draw, image, nullptr,
- SkRect::Make(image->bounds()).makeOffset(x, y),
- paint, SkCanvas::kFast_SrcRectConstraint)) {
- return;
- }
-
SkBitmap bm;
if (as_IB(image)->getROPixels(&bm, this->imageInfo().colorSpace())) {
this->drawBitmap(draw, bm, SkMatrix::MakeTrans(x, y), paint);
@@ -237,11 +184,6 @@ void SkBaseDevice::drawImage(const SkDraw& draw, const SkImage* image, SkScalar
void SkBaseDevice::drawImageRect(const SkDraw& draw, const SkImage* image, const SkRect* src,
const SkRect& dst, const SkPaint& paint,
SkCanvas::SrcRectConstraint constraint) {
- // Default impl : turns everything into raster bitmap
- if (this->drawExternallyScaledImage(draw, image, src, dst, paint, constraint)) {
- return;
- }
-
SkBitmap bm;
if (as_IB(image)->getROPixels(&bm, this->imageInfo().colorSpace())) {
this->drawBitmapRect(draw, bm, src, dst, paint, constraint);