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

Side by Side Diff: gm/imagefiltersgraph.cpp

Issue 196353021: Revert "Implement support for expanding crop rects in image filters" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « gm/imagefilterscropexpand.cpp ('k') | gyp/gmslides.gypi » ('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 2012 Google Inc. 2 * Copyright 2012 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 "gm.h" 8 #include "gm.h"
9 9
10 #include "SkArithmeticMode.h" 10 #include "SkArithmeticMode.h"
(...skipping 21 matching lines...) Expand all
32 virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx, 32 virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx,
33 SkBitmap* dst, SkIPoint* offset) const SK_OVERRID E { 33 SkBitmap* dst, SkIPoint* offset) const SK_OVERRID E {
34 SkBitmap source = src; 34 SkBitmap source = src;
35 SkImageFilter* input = getInput(0); 35 SkImageFilter* input = getInput(0);
36 SkIPoint srcOffset = SkIPoint::Make(0, 0); 36 SkIPoint srcOffset = SkIPoint::Make(0, 0);
37 if (NULL != input && !input->filterImage(proxy, src, ctx, &source, &srcO ffset)) { 37 if (NULL != input && !input->filterImage(proxy, src, ctx, &source, &srcO ffset)) {
38 return false; 38 return false;
39 } 39 }
40 40
41 SkIRect bounds; 41 SkIRect bounds;
42 if (!this->applyCropRect(ctx, proxy, source, &srcOffset, &bounds, &sourc e)) { 42 source.getBounds(&bounds);
43
44 if (!this->applyCropRect(&bounds, ctx.ctm())) {
43 return false; 45 return false;
44 } 46 }
45 47
46 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bo unds.height())); 48 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bo unds.height()));
47 SkCanvas canvas(device); 49 SkCanvas canvas(device);
48 SkPaint paint; 50 SkPaint paint;
49 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 51 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
50 canvas.drawBitmap(source, fDX - bounds.left(), fDY - bounds.top(), &pain t); 52 canvas.drawBitmap(source, fDX - bounds.left(), fDY - bounds.top(), &pain t);
51 *dst = device->accessBitmap(false); 53 *dst = device->accessBitmap(false);
52 offset->fX += bounds.left(); 54 offset->fX += bounds.left();
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 private: 208 private:
207 typedef GM INHERITED; 209 typedef GM INHERITED;
208 SkBitmap fBitmap; 210 SkBitmap fBitmap;
209 bool fInitialized; 211 bool fInitialized;
210 }; 212 };
211 213
212 /////////////////////////////////////////////////////////////////////////////// 214 ///////////////////////////////////////////////////////////////////////////////
213 215
214 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } 216 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; }
215 static skiagm::GMRegistry reg(MyFactory); 217 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/imagefilterscropexpand.cpp ('k') | gyp/gmslides.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698