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

Side by Side Diff: src/core/SkDeviceImageFilterProxy.h

Issue 1008863002: Revert of Change device creation to see the (optional) layer-paint (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/core/SkDevice.cpp ('k') | src/device/xps/SkXPSDevice.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 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
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 #ifndef SkDeviceImageFilterProxy_DEFINED 8 #ifndef SkDeviceImageFilterProxy_DEFINED
9 #define SkDeviceImageFilterProxy_DEFINED 9 #define SkDeviceImageFilterProxy_DEFINED
10 10
11 #include "SkDevice.h" 11 #include "SkDevice.h"
12 #include "SkImageFilter.h" 12 #include "SkImageFilter.h"
13 #include "SkSurfaceProps.h" 13 #include "SkSurfaceProps.h"
14 14
15 class SkDeviceImageFilterProxy : public SkImageFilter::Proxy { 15 class SkDeviceImageFilterProxy : public SkImageFilter::Proxy {
16 public: 16 public:
17 SkDeviceImageFilterProxy(SkBaseDevice* device, const SkSurfaceProps& props) 17 SkDeviceImageFilterProxy(SkBaseDevice* device, const SkSurfaceProps& props)
18 : fDevice(device) 18 : fDevice(device)
19 , fProps(props.flags(), 19 , fProps(props.flags(),
20 SkBaseDevice::CreateInfo::AdjustGeometry(SkImageInfo(), 20 SkBaseDevice::CreateInfo::AdjustGeometry(SkImageInfo(),
21 SkBaseDevice::kPossibl e_TileUsage, 21 SkBaseDevice::kImageFi lter_Usage,
22 props.pixelGeometry()) ) 22 props.pixelGeometry()) )
23 {} 23 {}
24 24
25 SkBaseDevice* createDevice(int w, int h) SK_OVERRIDE { 25 SkBaseDevice* createDevice(int w, int h) SK_OVERRIDE {
26 SkBaseDevice::CreateInfo cinfo(SkImageInfo::MakeN32Premul(w, h), 26 SkBaseDevice::CreateInfo cinfo(SkImageInfo::MakeN32Premul(w, h),
27 SkBaseDevice::kPossible_TileUsage, 27 SkBaseDevice::kImageFilter_Usage,
28 kUnknown_SkPixelGeometry); 28 kUnknown_SkPixelGeometry);
29 return fDevice->onCreateDevice(cinfo, NULL); 29 return fDevice->onCreateCompatibleDevice(cinfo);
30 } 30 }
31 bool canHandleImageFilter(const SkImageFilter* filter) SK_OVERRIDE { 31 bool canHandleImageFilter(const SkImageFilter* filter) SK_OVERRIDE {
32 return fDevice->canHandleImageFilter(filter); 32 return fDevice->canHandleImageFilter(filter);
33 } 33 }
34 virtual bool filterImage(const SkImageFilter* filter, const SkBitmap& src, 34 virtual bool filterImage(const SkImageFilter* filter, const SkBitmap& src,
35 const SkImageFilter::Context& ctx, 35 const SkImageFilter::Context& ctx,
36 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE { 36 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE {
37 return fDevice->filterImage(filter, src, ctx, result, offset); 37 return fDevice->filterImage(filter, src, ctx, result, offset);
38 } 38 }
39 39
40 const SkSurfaceProps* surfaceProps() const SK_OVERRIDE { 40 const SkSurfaceProps* surfaceProps() const SK_OVERRIDE {
41 return &fProps; 41 return &fProps;
42 } 42 }
43 43
44 private: 44 private:
45 SkBaseDevice* fDevice; 45 SkBaseDevice* fDevice;
46 const SkSurfaceProps fProps; 46 const SkSurfaceProps fProps;
47 }; 47 };
48 48
49 #endif 49 #endif
OLDNEW
« no previous file with comments | « src/core/SkDevice.cpp ('k') | src/device/xps/SkXPSDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698