Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: src/effects/SkImageSource.cpp

Issue 1823573003: Change signatures of filter bounds methods to return a rect. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Hide legacy API behind #ifdef; switch callers to new API Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkImageSource.h" 8 #include "SkImageSource.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 fSrcRect.width() == dstRect.width() && fSrcRect.height() == dstRect.heig ht() ? 106 fSrcRect.width() == dstRect.width() && fSrcRect.height() == dstRect.heig ht() ?
107 kNone_SkFilterQuality : fFilterQuality); 107 kNone_SkFilterQuality : fFilterQuality);
108 canvas->drawImageRect(fImage.get(), fSrcRect, dstRect, &paint, 108 canvas->drawImageRect(fImage.get(), fSrcRect, dstRect, &paint,
109 SkCanvas::kStrict_SrcRectConstraint); 109 SkCanvas::kStrict_SrcRectConstraint);
110 110
111 offset->fX = dstIRect.fLeft; 111 offset->fX = dstIRect.fLeft;
112 offset->fY = dstIRect.fTop; 112 offset->fY = dstIRect.fTop;
113 return surf->makeImageSnapshot().release(); 113 return surf->makeImageSnapshot().release();
114 } 114 }
115 115
116 void SkImageSource::computeFastBounds(const SkRect& src, SkRect* dst) const { 116 SkRect SkImageSource::computeFastBounds(const SkRect& src) const {
117 *dst = fDstRect; 117 return fDstRect;
118 } 118 }
119 119
120 #ifndef SK_IGNORE_TO_STRING 120 #ifndef SK_IGNORE_TO_STRING
121 void SkImageSource::toString(SkString* str) const { 121 void SkImageSource::toString(SkString* str) const {
122 str->appendf("SkImageSource: ("); 122 str->appendf("SkImageSource: (");
123 str->appendf("src: (%f,%f,%f,%f) dst: (%f,%f,%f,%f) ", 123 str->appendf("src: (%f,%f,%f,%f) dst: (%f,%f,%f,%f) ",
124 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto m, 124 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto m,
125 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto m); 125 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto m);
126 str->appendf("image: (%d,%d)", 126 str->appendf("image: (%d,%d)",
127 fImage->width(), fImage->height()); 127 fImage->width(), fImage->height());
128 str->append(")"); 128 str->append(")");
129 } 129 }
130 #endif 130 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698