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

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

Issue 22258005: Upstreaming DropShadowImageFilter into skia, from Blink (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Upstreaming DropShadowImageFilter into skia, from Blink Created 7 years, 4 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 | « include/effects/SkDropShadowImageFilter.h ('k') | src/ports/SkGlobalInitialization_default.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"
11 #include "SkBlurImageFilter.h" 11 #include "SkBlurImageFilter.h"
12 #include "SkCanvas.h" 12 #include "SkCanvas.h"
13 #include "SkColorMatrixFilter.h" 13 #include "SkColorMatrixFilter.h"
14 #include "SkDevice.h" 14 #include "SkDevice.h"
15 #include "SkFlattenableBuffers.h" 15 #include "SkFlattenableBuffers.h"
16 16
17 SkDropShadowImageFilter::SkDropShadowImageFilter(SkScalar dx, SkScalar dy, SkSca lar sigma, SkColor color, SkImageFilter* input) 17 SkDropShadowImageFilter::SkDropShadowImageFilter(SkScalar dx, SkScalar dy, SkSca lar sigma, SkColor color, SkImageFilter* input)
18 : SkImageFilter(input) 18 : SkImageFilter(input)
19 , fDx(dx) 19 , fDx(dx)
20 , fDy(dy) 20 , fDy(dy)
21 , fSigma(sigma) 21 , fSigma(sigma)
22 , fColor(color) 22 , fColor(color)
23 { 23 {
24 } 24 }
25 25
26 SkDropShadowImageFilter::SkDropShadowImageFilter(SkFlattenableReadBuffer& buffer ) : SkImageFilter(buffer) 26 SkDropShadowImageFilter::SkDropShadowImageFilter(SkFlattenableReadBuffer& buffer ) : INHERITED(buffer)
27 { 27 {
28 fDx = buffer.readScalar(); 28 fDx = buffer.readScalar();
29 fDy = buffer.readScalar(); 29 fDy = buffer.readScalar();
30 fSigma = buffer.readScalar(); 30 fSigma = buffer.readScalar();
31 fColor = buffer.readColor(); 31 fColor = buffer.readColor();
32 } 32 }
33 33
34 void SkDropShadowImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const 34 void SkDropShadowImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const
35 { 35 {
36 this->INHERITED::flatten(buffer); 36 this->INHERITED::flatten(buffer);
(...skipping 17 matching lines...) Expand all
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 }
63 63
OLDNEW
« no previous file with comments | « include/effects/SkDropShadowImageFilter.h ('k') | src/ports/SkGlobalInitialization_default.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698