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

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

Issue 1763143002: WIP RasterCanvasLayerAllocator (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add allocator-constancy sanitycheck Created 4 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
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 "SkImageFilter.h" 14 #include "SkImageFilter.h"
15 #include "SkSurfaceProps.h" 15 #include "SkSurfaceProps.h"
16 16
17 class SkBitmap; 17 class SkBitmap;
18 class SkClipStack; 18 class SkClipStack;
19 class SkDraw; 19 class SkDraw;
20 class SkDrawFilter; 20 class SkDrawFilter;
21 struct SkIRect; 21 struct SkIRect;
22 class SkMatrix; 22 class SkMatrix;
23 class SkMetaData; 23 class SkMetaData;
24 class SkRasterCanvasLayerAllocator;
24 class SkRegion; 25 class SkRegion;
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();
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 * Create a new device based on CreateInfo. If the paint is not null, then it represents a 368 * Create a new device based on CreateInfo. If the paint is not null, then it represents a
368 * preview of how the new device will be composed with its creator device ( this). 369 * preview of how the new device will be composed with its creator device ( this).
369 * 370 *
370 * The subclass may be handed this device in drawDevice(), so it must alway s return 371 * The subclass may be handed this device in drawDevice(), so it must alway s return
371 * a device that it knows how to draw, and that it knows how to identify if it is not of the 372 * a device that it knows how to draw, and that it knows how to identify if it is not of the
372 * same subclass (since drawDevice is passed a SkBaseDevice*). If the subcl ass cannot fulfill 373 * same subclass (since drawDevice is passed a SkBaseDevice*). If the subcl ass cannot fulfill
373 * that contract (e.g. PDF cannot support some settings on the paint) it sh ould return NULL, 374 * that contract (e.g. PDF cannot support some settings on the paint) it sh ould return NULL,
374 * and the caller may then decide to explicitly create a bitmapdevice, know ing that later 375 * and the caller may then decide to explicitly create a bitmapdevice, know ing that later
375 * it could not call drawDevice with it (but it could call drawSprite or dr awBitmap). 376 * it could not call drawDevice with it (but it could call drawSprite or dr awBitmap).
376 */ 377 */
377 virtual SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) { 378 virtual SkBaseDevice* onCreateDevice(const CreateInfo&,
379 const SkPaint*,
380 SkRasterCanvasLayerAllocator*) {
378 return NULL; 381 return NULL;
379 } 382 }
380 383
381 private: 384 private:
382 friend class SkCanvas; 385 friend class SkCanvas;
383 friend struct DeviceCM; //for setMatrixClip 386 friend struct DeviceCM; //for setMatrixClip
384 friend class SkDraw; 387 friend class SkDraw;
385 friend class SkDrawIter; 388 friend class SkDrawIter;
386 friend class SkDeviceFilteredPaint; 389 friend class SkDeviceFilteredPaint;
387 friend class SkImageFilter::DeviceProxy; 390 friend class SkImageFilter::DeviceProxy;
(...skipping 27 matching lines...) Expand all
415 SkSurfaceProps fSurfaceProps; 418 SkSurfaceProps fSurfaceProps;
416 419
417 #ifdef SK_DEBUG 420 #ifdef SK_DEBUG
418 bool fAttachedToCanvas; 421 bool fAttachedToCanvas;
419 #endif 422 #endif
420 423
421 typedef SkRefCnt INHERITED; 424 typedef SkRefCnt INHERITED;
422 }; 425 };
423 426
424 #endif 427 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698