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

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

Issue 798593003: Revert of Defer saves() until they're needed (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 | src/core/SkCanvas.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 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 1258
1259 SkClipStack fClipStack; 1259 SkClipStack fClipStack;
1260 SkDeque fMCStack; 1260 SkDeque fMCStack;
1261 // points to top of stack 1261 // points to top of stack
1262 MCRec* fMCRec; 1262 MCRec* fMCRec;
1263 // the first N recs that can fit here mean we won't call malloc 1263 // the first N recs that can fit here mean we won't call malloc
1264 uint32_t fMCRecStorage[32]; 1264 uint32_t fMCRecStorage[32];
1265 1265
1266 const SkSurfaceProps fProps; 1266 const SkSurfaceProps fProps;
1267 1267
1268 int fSaveCount; // value returned by getSaveCount()
1269 int fSaveLayerCount; // number of successful saveLayer calls 1268 int fSaveLayerCount; // number of successful saveLayer calls
1270 int fCullCount; // number of active culls 1269 int fCullCount; // number of active culls
1271 1270
1272 SkMetaData* fMetaData; 1271 SkMetaData* fMetaData;
1273 1272
1274 SkSurface_Base* fSurfaceBase; 1273 SkSurface_Base* fSurfaceBase;
1275 SkSurface_Base* getSurfaceBase() const { return fSurfaceBase; } 1274 SkSurface_Base* getSurfaceBase() const { return fSurfaceBase; }
1276 void setSurfaceBase(SkSurface_Base* sb) { 1275 void setSurfaceBase(SkSurface_Base* sb) {
1277 fSurfaceBase = sb; 1276 fSurfaceBase = sb;
1278 } 1277 }
1279 friend class SkSurface_Base; 1278 friend class SkSurface_Base;
1280 friend class SkSurface_Gpu; 1279 friend class SkSurface_Gpu;
1281 1280
1282 bool fDeviceCMDirty; // cleared by updateDeviceCMCache() 1281 bool fDeviceCMDirty; // cleared by updateDeviceCMCache()
1283 void updateDeviceCMCache(); 1282 void updateDeviceCMCache();
1284 1283
1285 void doSave();
1286 void checkForDeferredSave();
1287
1288 friend class SkDrawIter; // needs setupDrawForLayerDevice() 1284 friend class SkDrawIter; // needs setupDrawForLayerDevice()
1289 friend class AutoDrawLooper; 1285 friend class AutoDrawLooper;
1290 friend class SkLua; // needs top layer size and offset 1286 friend class SkLua; // needs top layer size and offset
1291 friend class SkDebugCanvas; // needs experimental fAllowSimplifyClip 1287 friend class SkDebugCanvas; // needs experimental fAllowSimplifyClip
1292 friend class SkDeferredDevice; // needs getTopDevice() 1288 friend class SkDeferredDevice; // needs getTopDevice()
1293 friend class SkSurface_Raster; // needs getDevice() 1289 friend class SkSurface_Raster; // needs getDevice()
1294 friend class SkRecorder; // InitFlags 1290 friend class SkRecorder; // InitFlags
1295 friend class SkNoSaveLayerCanvas; // InitFlags 1291 friend class SkNoSaveLayerCanvas; // InitFlags
1296 friend class SkPictureImageFilter; // SkCanvas(SkBaseDevice*, SkSurfaceProp s*, InitFlags) 1292 friend class SkPictureImageFilter; // SkCanvas(SkBaseDevice*, SkSurfaceProp s*, InitFlags)
1297 1293
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 1327
1332 // internal methods are not virtual, so they can safely be called by other 1328 // internal methods are not virtual, so they can safely be called by other
1333 // canvas apis, without confusing subclasses (like SkPictureRecording) 1329 // canvas apis, without confusing subclasses (like SkPictureRecording)
1334 void internalDrawBitmap(const SkBitmap&, const SkMatrix& m, const SkPaint* p aint); 1330 void internalDrawBitmap(const SkBitmap&, const SkMatrix& m, const SkPaint* p aint);
1335 void internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, 1331 void internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
1336 const SkRect& dst, const SkPaint* paint, 1332 const SkRect& dst, const SkPaint* paint,
1337 DrawBitmapRectFlags flags); 1333 DrawBitmapRectFlags flags);
1338 void internalDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, 1334 void internalDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
1339 const SkRect& dst, const SkPaint* paint); 1335 const SkRect& dst, const SkPaint* paint);
1340 void internalDrawPaint(const SkPaint& paint); 1336 void internalDrawPaint(const SkPaint& paint);
1341 void internalSaveLayer(const SkRect* bounds, const SkPaint* paint, 1337 int internalSaveLayer(const SkRect* bounds, const SkPaint* paint,
1342 SaveFlags, bool justForImageFilter, SaveLayerStrategy strategy); 1338 SaveFlags, bool justForImageFilter, SaveLayerStrategy strategy);
1343 void internalDrawDevice(SkBaseDevice*, int x, int y, const SkPaint*); 1339 void internalDrawDevice(SkBaseDevice*, int x, int y, const SkPaint*);
1344 1340
1345 // shared by save() and saveLayer() 1341 // shared by save() and saveLayer()
1346 void internalSave(); 1342 int internalSave();
1347 void internalRestore(); 1343 void internalRestore();
1348 static void DrawRect(const SkDraw& draw, const SkPaint& paint, 1344 static void DrawRect(const SkDraw& draw, const SkPaint& paint,
1349 const SkRect& r, SkScalar textSize); 1345 const SkRect& r, SkScalar textSize);
1350 static void DrawTextDecorations(const SkDraw& draw, const SkPaint& paint, 1346 static void DrawTextDecorations(const SkDraw& draw, const SkPaint& paint,
1351 const char text[], size_t byteLength, 1347 const char text[], size_t byteLength,
1352 SkScalar x, SkScalar y); 1348 SkScalar x, SkScalar y);
1353 1349
1354 // only for canvasutils 1350 // only for canvasutils
1355 const SkRegion& internal_private_getTotalClip() const; 1351 const SkRegion& internal_private_getTotalClip() const;
1356 1352
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 1507
1512 class SkCanvasClipVisitor { 1508 class SkCanvasClipVisitor {
1513 public: 1509 public:
1514 virtual ~SkCanvasClipVisitor(); 1510 virtual ~SkCanvasClipVisitor();
1515 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; 1511 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0;
1516 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; 1512 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0;
1517 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; 1513 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0;
1518 }; 1514 };
1519 1515
1520 #endif 1516 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698