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

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

Issue 645773002: Turn SkCanvasStateUtils into a class with static functions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « gm/beziers.cpp ('k') | include/utils/SkCanvasStateUtils.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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 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 SkCanvas_DEFINED 8 #ifndef SkCanvas_DEFINED
9 #define SkCanvas_DEFINED 9 #define SkCanvas_DEFINED
10 10
(...skipping 23 matching lines...) Expand all
34 class SkPicture; 34 class SkPicture;
35 class SkRRect; 35 class SkRRect;
36 class SkSurface; 36 class SkSurface;
37 class SkSurface_Base; 37 class SkSurface_Base;
38 class SkTextBlob; 38 class SkTextBlob;
39 class GrContext; 39 class GrContext;
40 class GrRenderTarget; 40 class GrRenderTarget;
41 41
42 class SkCanvasState; 42 class SkCanvasState;
43 43
44 namespace SkCanvasStateUtils {
45 SK_API SkCanvasState* CaptureCanvasState(SkCanvas*);
46 }
47
48 /** \class SkCanvas 44 /** \class SkCanvas
49 45
50 A Canvas encapsulates all of the state about drawing into a device (bitmap). 46 A Canvas encapsulates all of the state about drawing into a device (bitmap).
51 This includes a reference to the device itself, and a stack of matrix/clip 47 This includes a reference to the device itself, and a stack of matrix/clip
52 values. For any given draw call (e.g. drawRect), the geometry of the object 48 values. For any given draw call (e.g. drawRect), the geometry of the object
53 being drawn is transformed by the concatenation of all the matrices in the 49 being drawn is transformed by the concatenation of all the matrices in the
54 stack. The transformed geometry is clipped by the intersection of all of 50 stack. The transformed geometry is clipped by the intersection of all of
55 the clips in the stack. 51 the clips in the stack.
56 52
57 While the Canvas holds the state of the drawing device, the state (style) 53 While the Canvas holds the state of the drawing device, the state (style)
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 1336
1341 enum InitFlags { 1337 enum InitFlags {
1342 kDefault_InitFlags = 0, 1338 kDefault_InitFlags = 0,
1343 kConservativeRasterClip_InitFlag = 1 << 0, 1339 kConservativeRasterClip_InitFlag = 1 << 0,
1344 }; 1340 };
1345 SkCanvas(int width, int height, InitFlags); 1341 SkCanvas(int width, int height, InitFlags);
1346 SkCanvas(SkBaseDevice*, const SkSurfaceProps*, InitFlags); 1342 SkCanvas(SkBaseDevice*, const SkSurfaceProps*, InitFlags);
1347 SkCanvas(const SkBitmap&, const SkSurfaceProps&); 1343 SkCanvas(const SkBitmap&, const SkSurfaceProps&);
1348 1344
1349 // needs gettotalclip() 1345 // needs gettotalclip()
1350 friend SkCanvasState* SkCanvasStateUtils::CaptureCanvasState(SkCanvas*); 1346 friend class SkCanvasStateUtils;
1351 1347
1352 SkBaseDevice* createLayerDevice(const SkImageInfo&); 1348 SkBaseDevice* createLayerDevice(const SkImageInfo&);
1353 1349
1354 // call this each time we attach ourselves to a device 1350 // call this each time we attach ourselves to a device
1355 // - constructor 1351 // - constructor
1356 // - internalSaveLayer 1352 // - internalSaveLayer
1357 void setupDevice(SkBaseDevice*); 1353 void setupDevice(SkBaseDevice*);
1358 1354
1359 SkBaseDevice* init(SkBaseDevice*, InitFlags); 1355 SkBaseDevice* init(SkBaseDevice*, InitFlags);
1360 1356
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 1552
1557 class SkCanvasClipVisitor { 1553 class SkCanvasClipVisitor {
1558 public: 1554 public:
1559 virtual ~SkCanvasClipVisitor(); 1555 virtual ~SkCanvasClipVisitor();
1560 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; 1556 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0;
1561 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; 1557 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0;
1562 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; 1558 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0;
1563 }; 1559 };
1564 1560
1565 #endif 1561 #endif
OLDNEW
« no previous file with comments | « gm/beziers.cpp ('k') | include/utils/SkCanvasStateUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698