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

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

Issue 1897863008: Hide SkCanvas::LayerIter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix debug build Created 4 years, 8 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 | « no previous file | samplecode/SampleLayers.cpp » ('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 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 typedef SkCanvasClipVisitor ClipVisitor; 1213 typedef SkCanvasClipVisitor ClipVisitor;
1214 /** 1214 /**
1215 * Replays the clip operations, back to front, that have been applied to 1215 * Replays the clip operations, back to front, that have been applied to
1216 * the canvas, calling the appropriate method on the visitor for each 1216 * the canvas, calling the appropriate method on the visitor for each
1217 * clip. All clips have already been transformed into device space. 1217 * clip. All clips have already been transformed into device space.
1218 */ 1218 */
1219 void replayClips(ClipVisitor*) const; 1219 void replayClips(ClipVisitor*) const;
1220 1220
1221 /////////////////////////////////////////////////////////////////////////// 1221 ///////////////////////////////////////////////////////////////////////////
1222 1222
1223 protected:
1223 /** After calling saveLayer(), there can be any number of devices that make 1224 /** After calling saveLayer(), there can be any number of devices that make
1224 up the top-most drawing area. LayerIter can be used to iterate through 1225 up the top-most drawing area. LayerIter can be used to iterate through
1225 those devices. Note that the iterator is only valid until the next API 1226 those devices. Note that the iterator is only valid until the next API
1226 call made on the canvas. Ownership of all pointers in the iterator stays 1227 call made on the canvas. Ownership of all pointers in the iterator stays
1227 with the canvas, so none of them should be modified or deleted. 1228 with the canvas, so none of them should be modified or deleted.
1228 */ 1229 */
1229 class SK_API LayerIter /*: SkNoncopyable*/ { 1230 class SK_API LayerIter /*: SkNoncopyable*/ {
1230 public: 1231 public:
1231 /** Initialize iterator with canvas, and set values for 1st device */ 1232 /** Initialize iterator with canvas, and set values for 1st device */
1232 LayerIter(SkCanvas*, bool skipEmptyClips); 1233 LayerIter(SkCanvas*, bool skipEmptyClips);
(...skipping 18 matching lines...) Expand all
1251 // having to expose that class def to the public. There is an assert 1252 // having to expose that class def to the public. There is an assert
1252 // in our constructor to ensure that fStorage is large enough 1253 // in our constructor to ensure that fStorage is large enough
1253 // (though needs to be a compile-time-assert!). We use intptr_t to work 1254 // (though needs to be a compile-time-assert!). We use intptr_t to work
1254 // safely with 32 and 64 bit machines (to ensure the storage is enough) 1255 // safely with 32 and 64 bit machines (to ensure the storage is enough)
1255 intptr_t fStorage[32]; 1256 intptr_t fStorage[32];
1256 class SkDrawIter* fImpl; // this points at fStorage 1257 class SkDrawIter* fImpl; // this points at fStorage
1257 SkPaint fDefaultPaint; 1258 SkPaint fDefaultPaint;
1258 bool fDone; 1259 bool fDone;
1259 }; 1260 };
1260 1261
1262 public:
1261 // don't call 1263 // don't call
1262 GrRenderTarget* internal_private_accessTopLayerRenderTarget(); 1264 GrRenderTarget* internal_private_accessTopLayerRenderTarget();
1263 1265
1264 // don't call 1266 // don't call
1265 static void Internal_Private_SetIgnoreSaveLayerBounds(bool); 1267 static void Internal_Private_SetIgnoreSaveLayerBounds(bool);
1266 static bool Internal_Private_GetIgnoreSaveLayerBounds(); 1268 static bool Internal_Private_GetIgnoreSaveLayerBounds();
1267 static void Internal_Private_SetTreatSpriteAsBitmap(bool); 1269 static void Internal_Private_SetTreatSpriteAsBitmap(bool);
1268 static bool Internal_Private_GetTreatSpriteAsBitmap(); 1270 static bool Internal_Private_GetTreatSpriteAsBitmap();
1269 1271
1270 // TEMP helpers until we switch virtual over to const& for src-rect 1272 // TEMP helpers until we switch virtual over to const& for src-rect
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 } 1426 }
1425 friend class SkSurface_Base; 1427 friend class SkSurface_Base;
1426 friend class SkSurface_Gpu; 1428 friend class SkSurface_Gpu;
1427 1429
1428 bool fDeviceCMDirty; // cleared by updateDeviceCMCache() 1430 bool fDeviceCMDirty; // cleared by updateDeviceCMCache()
1429 void updateDeviceCMCache(); 1431 void updateDeviceCMCache();
1430 1432
1431 void doSave(); 1433 void doSave();
1432 void checkForDeferredSave(); 1434 void checkForDeferredSave();
1433 1435
1436 friend class CanvasTestingAccess; // for testing
1434 friend class SkDrawIter; // needs setupDrawForLayerDevice() 1437 friend class SkDrawIter; // needs setupDrawForLayerDevice()
1435 friend class AutoDrawLooper; 1438 friend class AutoDrawLooper;
1436 friend class SkLua; // needs top layer size and offset 1439 friend class SkLua; // needs top layer size and offset
1437 friend class SkDebugCanvas; // needs experimental fAllowSimplifyClip 1440 friend class SkDebugCanvas; // needs experimental fAllowSimplifyClip
1438 friend class SkSurface_Raster; // needs getDevice() 1441 friend class SkSurface_Raster; // needs getDevice()
1439 friend class SkRecorder; // InitFlags 1442 friend class SkRecorder; // InitFlags
1440 friend class SkNoSaveLayerCanvas; // InitFlags 1443 friend class SkNoSaveLayerCanvas; // InitFlags
1441 friend class SkPictureImageFilter; // SkCanvas(SkBaseDevice*, SkSurfaceProp s*, InitFlags) 1444 friend class SkPictureImageFilter; // SkCanvas(SkBaseDevice*, SkSurfaceProp s*, InitFlags)
1442 friend class SkPictureRecord; // predrawNotify (why does it need it? <reed >) 1445 friend class SkPictureRecord; // predrawNotify (why does it need it? <reed >)
1443 friend class SkPicturePlayback; // SaveFlagsToSaveLayerFlags 1446 friend class SkPicturePlayback; // SaveFlagsToSaveLayerFlags
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 1579
1577 class SkCanvasClipVisitor { 1580 class SkCanvasClipVisitor {
1578 public: 1581 public:
1579 virtual ~SkCanvasClipVisitor(); 1582 virtual ~SkCanvasClipVisitor();
1580 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; 1583 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0;
1581 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; 1584 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0;
1582 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; 1585 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0;
1583 }; 1586 };
1584 1587
1585 #endif 1588 #endif
OLDNEW
« no previous file with comments | « no previous file | samplecode/SampleLayers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698