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

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

Issue 2155063002: use special-image for imagefilters and save/restore layer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright 2010 The Android Open Source Project 2 * Copyright 2010 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 SkDevice_DEFINED 8 #ifndef SkDevice_DEFINED
9 #define SkDevice_DEFINED 9 #define SkDevice_DEFINED
10 10
11 #include "SkRefCnt.h" 11 #include "SkRefCnt.h"
12 #include "SkCanvas.h" 12 #include "SkCanvas.h"
13 #include "SkColor.h" 13 #include "SkColor.h"
14 #include "SkSurfaceProps.h" 14 #include "SkSurfaceProps.h"
15 15
16 class SkBitmap; 16 class SkBitmap;
17 class SkClipStack; 17 class SkClipStack;
18 class SkDraw; 18 class SkDraw;
19 class SkDrawFilter; 19 class SkDrawFilter;
20 class SkImageFilterCache; 20 class SkImageFilterCache;
21 struct SkIRect; 21 struct SkIRect;
22 class SkMatrix; 22 class SkMatrix;
23 class SkMetaData; 23 class SkMetaData;
24 class SkRegion; 24 class SkRegion;
25 class SkSpecialImage;
25 class GrRenderTarget; 26 class GrRenderTarget;
26 27
27 class SK_API SkBaseDevice : public SkRefCnt { 28 class SK_API SkBaseDevice : public SkRefCnt {
28 public: 29 public:
29 /** 30 /**
30 * Construct a new device. 31 * Construct a new device.
31 */ 32 */
32 explicit SkBaseDevice(const SkSurfaceProps&); 33 explicit SkBaseDevice(const SkSurfaceProps&);
33 virtual ~SkBaseDevice(); 34 virtual ~SkBaseDevice();
34 35
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 onCreateDevice on this device with kNeverTile_TileExpectation. 270 onCreateDevice on this device with kNeverTile_TileExpectation.
270 */ 271 */
271 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, 272 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y,
272 const SkPaint&) = 0; 273 const SkPaint&) = 0;
273 274
274 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, con st SkPath&, 275 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, con st SkPath&,
275 const SkMatrix*, const SkPaint&); 276 const SkMatrix*, const SkPaint&);
276 virtual void drawTextRSXform(const SkDraw&, const void* text, size_t len, co nst SkRSXform[], 277 virtual void drawTextRSXform(const SkDraw&, const void* text, size_t len, co nst SkRSXform[],
277 const SkPaint&); 278 const SkPaint&);
278 279
280 virtual void drawSpecial(const SkDraw&, SkSpecialImage*, int x, int y, const SkPaint&);
281 virtual sk_sp<SkSpecialImage> makeSpecial(const SkBitmap&);
282 virtual sk_sp<SkSpecialImage> makeSpecial(const SkImage*);
283 virtual sk_sp<SkSpecialImage> asSpecial();
284
279 bool readPixels(const SkImageInfo&, void* dst, size_t rowBytes, int x, int y ); 285 bool readPixels(const SkImageInfo&, void* dst, size_t rowBytes, int x, int y );
280 286
281 /////////////////////////////////////////////////////////////////////////// 287 ///////////////////////////////////////////////////////////////////////////
282 288
283 /** Update as needed the pixel value in the bitmap, so that the caller can 289 /** Update as needed the pixel value in the bitmap, so that the caller can
284 access the pixels directly. 290 access the pixels directly.
285 @return The device contents as a bitmap 291 @return The device contents as a bitmap
286 */ 292 */
287 virtual const SkBitmap& onAccessBitmap() = 0; 293 virtual const SkBitmap& onAccessBitmap() = 0;
288 294
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 SkSurfaceProps fSurfaceProps; 398 SkSurfaceProps fSurfaceProps;
393 399
394 #ifdef SK_DEBUG 400 #ifdef SK_DEBUG
395 bool fAttachedToCanvas; 401 bool fAttachedToCanvas;
396 #endif 402 #endif
397 403
398 typedef SkRefCnt INHERITED; 404 typedef SkRefCnt INHERITED;
399 }; 405 };
400 406
401 #endif 407 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698