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

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

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