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

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

Issue 1763143002: WIP RasterCanvasLayerAllocator (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: test and some further work Created 4 years, 7 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 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 * Create a new device based on CreateInfo. If the paint is not null, then it represents a 355 * Create a new device based on CreateInfo. If the paint is not null, then it represents a
355 * preview of how the new device will be composed with its creator device ( this). 356 * preview of how the new device will be composed with its creator device ( this).
356 * 357 *
357 * The subclass may be handed this device in drawDevice(), so it must alway s return 358 * The subclass may be handed this device in drawDevice(), so it must alway s return
358 * a device that it knows how to draw, and that it knows how to identify if it is not of the 359 * a device that it knows how to draw, and that it knows how to identify if it is not of the
359 * same subclass (since drawDevice is passed a SkBaseDevice*). If the subcl ass cannot fulfill 360 * same subclass (since drawDevice is passed a SkBaseDevice*). If the subcl ass cannot fulfill
360 * that contract (e.g. PDF cannot support some settings on the paint) it sh ould return NULL, 361 * that contract (e.g. PDF cannot support some settings on the paint) it sh ould return NULL,
361 * and the caller may then decide to explicitly create a bitmapdevice, know ing that later 362 * and the caller may then decide to explicitly create a bitmapdevice, know ing that later
362 * it could not call drawDevice with it (but it could call drawSprite or dr awBitmap). 363 * it could not call drawDevice with it (but it could call drawSprite or dr awBitmap).
363 */ 364 */
364 virtual SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) { 365 virtual SkBaseDevice* onCreateDevice(const CreateInfo&,
366 const SkPaint*,
367 SkRasterCanvasLayerAllocator*) {
365 return NULL; 368 return NULL;
366 } 369 }
367 370
368 /** 371 /**
369 * Calls through to drawSprite, processing the imagefilter. 372 * Calls through to drawSprite, processing the imagefilter.
370 */ 373 */
371 virtual void drawSpriteWithFilter(const SkDraw&, const SkBitmap&, 374 virtual void drawSpriteWithFilter(const SkDraw&, const SkBitmap&,
372 int x, int y, const SkPaint&); 375 int x, int y, const SkPaint&);
373 376
374 // A helper function used by derived classes to log the scale factor of a bi tmap or image draw. 377 // A helper function used by derived classes to log the scale factor of a bi tmap or image draw.
(...skipping 30 matching lines...) Expand all
405 SkSurfaceProps fSurfaceProps; 408 SkSurfaceProps fSurfaceProps;
406 409
407 #ifdef SK_DEBUG 410 #ifdef SK_DEBUG
408 bool fAttachedToCanvas; 411 bool fAttachedToCanvas;
409 #endif 412 #endif
410 413
411 typedef SkRefCnt INHERITED; 414 typedef SkRefCnt INHERITED;
412 }; 415 };
413 416
414 #endif 417 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698