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

Side by Side Diff: gm/imagefiltersgraph.cpp

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 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 | « gm/image.cpp ('k') | gm/samplerstress.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 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 28 matching lines...) Expand all
39 }; 39 };
40 static SkImageFilter* Create(SkScalar dx, SkScalar dy, SkImageFilter* input) { 40 static SkImageFilter* Create(SkScalar dx, SkScalar dy, SkImageFilter* input) {
41 return SkNEW_ARGS(SimpleOffsetFilter, (dx, dy, input)); 41 return SkNEW_ARGS(SimpleOffsetFilter, (dx, dy, input));
42 } 42 }
43 43
44 virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx, 44 virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx,
45 SkBitmap* dst, SkIPoint* offset) const SK_OVERRID E { 45 SkBitmap* dst, SkIPoint* offset) const SK_OVERRID E {
46 SkBitmap source = src; 46 SkBitmap source = src;
47 SkImageFilter* input = getInput(0); 47 SkImageFilter* input = getInput(0);
48 SkIPoint srcOffset = SkIPoint::Make(0, 0); 48 SkIPoint srcOffset = SkIPoint::Make(0, 0);
49 if (NULL != input && !input->filterImage(proxy, src, ctx, &source, &srcO ffset)) { 49 if (input && !input->filterImage(proxy, src, ctx, &source, &srcOffset)) {
50 return false; 50 return false;
51 } 51 }
52 52
53 SkIRect bounds; 53 SkIRect bounds;
54 if (!this->applyCropRect(ctx, proxy, source, &srcOffset, &bounds, &sourc e)) { 54 if (!this->applyCropRect(ctx, proxy, source, &srcOffset, &bounds, &sourc e)) {
55 return false; 55 return false;
56 } 56 }
57 57
58 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bo unds.height())); 58 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bo unds.height()));
59 SkCanvas canvas(device); 59 SkCanvas canvas(device);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 private: 232 private:
233 typedef GM INHERITED; 233 typedef GM INHERITED;
234 SkBitmap fBitmap; 234 SkBitmap fBitmap;
235 }; 235 };
236 236
237 /////////////////////////////////////////////////////////////////////////////// 237 ///////////////////////////////////////////////////////////////////////////////
238 238
239 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } 239 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; }
240 static skiagm::GMRegistry reg(MyFactory); 240 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/image.cpp ('k') | gm/samplerstress.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698