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

Side by Side Diff: include/core/SkDevice.h

Issue 189913021: Implement support for a Context parameter in image filters (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Revert all but the Context changes. 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 | « include/core/SkBitmapDevice.h ('k') | include/core/SkImageFilter.h » ('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 /* 2 /*
3 * Copyright 2010 The Android Open Source Project 3 * Copyright 2010 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkDevice_DEFINED 10 #ifndef SkDevice_DEFINED
11 #define SkDevice_DEFINED 11 #define SkDevice_DEFINED
12 12
13 #include "SkRefCnt.h" 13 #include "SkRefCnt.h"
14 #include "SkBitmap.h" 14 #include "SkBitmap.h"
15 #include "SkCanvas.h" 15 #include "SkCanvas.h"
16 #include "SkColor.h" 16 #include "SkColor.h"
17 #include "SkDeviceProperties.h" 17 #include "SkDeviceProperties.h"
18 #include "SkImageFilter.h"
18 19
19 // getDeviceCapabilities() is not called by skia, but this flag keeps it around 20 // getDeviceCapabilities() is not called by skia, but this flag keeps it around
20 // for clients that have "override" annotations on their subclass. These overrid es 21 // for clients that have "override" annotations on their subclass. These overrid es
21 // should be deleted. 22 // should be deleted.
22 //#define SK_SUPPORT_LEGACY_GETDEVICECAPABILITIES 23 //#define SK_SUPPORT_LEGACY_GETDEVICECAPABILITIES
23 24
24 //#define SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG 25 //#define SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG
25 26
26 class SkClipStack; 27 class SkClipStack;
27 class SkDraw; 28 class SkDraw;
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 */ 366 */
366 virtual bool canHandleImageFilter(const SkImageFilter*) = 0; 367 virtual bool canHandleImageFilter(const SkImageFilter*) = 0;
367 368
368 /** 369 /**
369 * Related (but not required) to canHandleImageFilter, this method returns 370 * Related (but not required) to canHandleImageFilter, this method returns
370 * true if the device could apply the filter to the src bitmap and return 371 * true if the device could apply the filter to the src bitmap and return
371 * the result (and updates offset as needed). 372 * the result (and updates offset as needed).
372 * If the device does not recognize or support this filter, 373 * If the device does not recognize or support this filter,
373 * it just returns false and leaves result and offset unchanged. 374 * it just returns false and leaves result and offset unchanged.
374 */ 375 */
375 virtual bool filterImage(const SkImageFilter*, const SkBitmap&, const SkMatr ix&, 376 virtual bool filterImage(const SkImageFilter*, const SkBitmap&,
377 const SkImageFilter::Context& ctx,
376 SkBitmap* result, SkIPoint* offset) = 0; 378 SkBitmap* result, SkIPoint* offset) = 0;
377 379
378 // This is equal kBGRA_Premul_Config8888 or kRGBA_Premul_Config8888 if 380 // This is equal kBGRA_Premul_Config8888 or kRGBA_Premul_Config8888 if
379 // either is identical to kNative_Premul_Config8888. Otherwise, -1. 381 // either is identical to kNative_Premul_Config8888. Otherwise, -1.
380 static const SkCanvas::Config8888 kPMColorAlias; 382 static const SkCanvas::Config8888 kPMColorAlias;
381 383
382 protected: 384 protected:
383 // default impl returns NULL 385 // default impl returns NULL
384 virtual SkSurface* newSurface(const SkImageInfo&); 386 virtual SkSurface* newSurface(const SkImageInfo&);
385 387
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 SkMetaData* fMetaData; 466 SkMetaData* fMetaData;
465 467
466 #ifdef SK_DEBUG 468 #ifdef SK_DEBUG
467 bool fAttachedToCanvas; 469 bool fAttachedToCanvas;
468 #endif 470 #endif
469 471
470 typedef SkRefCnt INHERITED; 472 typedef SkRefCnt INHERITED;
471 }; 473 };
472 474
473 #endif 475 #endif
OLDNEW
« no previous file with comments | « include/core/SkBitmapDevice.h ('k') | include/core/SkImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698