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

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

Issue 1709753002: Mark existing image filter entry points that will be going away with Deprecated (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT Created 4 years, 10 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
« no previous file with comments | « src/effects/SkDropShadowImageFilter.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 return SkImageSource::Create(image, src, dst, filterQuality); 57 return SkImageSource::Create(image, src, dst, filterQuality);
58 } 58 }
59 59
60 void SkImageSource::flatten(SkWriteBuffer& buffer) const { 60 void SkImageSource::flatten(SkWriteBuffer& buffer) const {
61 buffer.writeInt(fFilterQuality); 61 buffer.writeInt(fFilterQuality);
62 buffer.writeRect(fSrcRect); 62 buffer.writeRect(fSrcRect);
63 buffer.writeRect(fDstRect); 63 buffer.writeRect(fDstRect);
64 buffer.writeImage(fImage); 64 buffer.writeImage(fImage);
65 } 65 }
66 66
67 bool SkImageSource::onFilterImage(Proxy* proxy, const SkBitmap& src, const Conte xt& ctx, 67 bool SkImageSource::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& src, c onst Context& ctx,
68 SkBitmap* result, SkIPoint* offset) const { 68 SkBitmap* result, SkIPoint* offset) const {
69 SkRect dstRect; 69 SkRect dstRect;
70 ctx.ctm().mapRect(&dstRect, fDstRect); 70 ctx.ctm().mapRect(&dstRect, fDstRect);
71 SkRect bounds = SkRect::MakeIWH(fImage->width(), fImage->height()); 71 SkRect bounds = SkRect::MakeIWH(fImage->width(), fImage->height());
72 if (fSrcRect == bounds && dstRect == bounds) { 72 if (fSrcRect == bounds && dstRect == bounds) {
73 // No regions cropped out or resized; return entire image. 73 // No regions cropped out or resized; return entire image.
74 offset->fX = offset->fY = 0; 74 offset->fX = offset->fY = 0;
75 return fImage->asLegacyBitmap(result, SkImage::kRO_LegacyBitmapMode); 75 return fImage->asLegacyBitmap(result, SkImage::kRO_LegacyBitmapMode);
76 } 76 }
77 77
78 const SkIRect dstIRect = dstRect.roundOut(); 78 const SkIRect dstIRect = dstRect.roundOut();
(...skipping 30 matching lines...) Expand all
109 void SkImageSource::toString(SkString* str) const { 109 void SkImageSource::toString(SkString* str) const {
110 str->appendf("SkImageSource: ("); 110 str->appendf("SkImageSource: (");
111 str->appendf("src: (%f,%f,%f,%f) dst: (%f,%f,%f,%f) ", 111 str->appendf("src: (%f,%f,%f,%f) dst: (%f,%f,%f,%f) ",
112 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto m, 112 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto m,
113 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto m); 113 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto m);
114 str->appendf("image: (%d,%d)", 114 str->appendf("image: (%d,%d)",
115 fImage->width(), fImage->height()); 115 fImage->width(), fImage->height());
116 str->append(")"); 116 str->append(")");
117 } 117 }
118 #endif 118 #endif
OLDNEW
« no previous file with comments | « src/effects/SkDropShadowImageFilter.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698