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

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

Issue 22978012: Split SkDevice into SkBaseDevice and SkBitmapDevice (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Updating to ToT (10994) Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/SkColorFilterImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.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 2013 Google Inc. 2 * Copyright 2013 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 "SkDropShadowImageFilter.h" 8 #include "SkDropShadowImageFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 28 matching lines...) Expand all
39 buffer.writeScalar(fSigma); 39 buffer.writeScalar(fSigma);
40 buffer.writeColor(fColor); 40 buffer.writeColor(fColor);
41 } 41 }
42 42
43 bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source , const SkMatrix& matrix, SkBitmap* result, SkIPoint* loc) 43 bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source , const SkMatrix& matrix, SkBitmap* result, SkIPoint* loc)
44 { 44 {
45 SkBitmap src = source; 45 SkBitmap src = source;
46 if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, lo c)) 46 if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, lo c))
47 return false; 47 return false;
48 48
49 SkAutoTUnref<SkDevice> device(proxy->createDevice(src.width(), src.height()) ); 49 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(src.width(), src.heigh t()));
50 SkCanvas canvas(device.get()); 50 SkCanvas canvas(device.get());
51 51
52 SkAutoTUnref<SkImageFilter> blurFilter(new SkBlurImageFilter(fSigma, fSigma) ); 52 SkAutoTUnref<SkImageFilter> blurFilter(new SkBlurImageFilter(fSigma, fSigma) );
53 SkAutoTUnref<SkColorFilter> colorFilter(SkColorFilter::CreateModeFilter(fCol or, SkXfermode::kSrcIn_Mode)); 53 SkAutoTUnref<SkColorFilter> colorFilter(SkColorFilter::CreateModeFilter(fCol or, SkXfermode::kSrcIn_Mode));
54 SkPaint paint; 54 SkPaint paint;
55 paint.setImageFilter(blurFilter.get()); 55 paint.setImageFilter(blurFilter.get());
56 paint.setColorFilter(colorFilter.get()); 56 paint.setColorFilter(colorFilter.get());
57 paint.setXfermodeMode(SkXfermode::kSrcOver_Mode); 57 paint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
58 canvas.drawBitmap(src, fDx, fDy, &paint); 58 canvas.drawBitmap(src, fDx, fDy, &paint);
59 canvas.drawBitmap(src, 0, 0); 59 canvas.drawBitmap(src, 0, 0);
60 *result = device->accessBitmap(false); 60 *result = device->accessBitmap(false);
61 return true; 61 return true;
62 } 62 }
OLDNEW
« no previous file with comments | « src/effects/SkColorFilterImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698