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

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

Issue 177073006: add isClipEmpty() -- encourage clients to call this rather than checking clipFoo() results (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« 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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 exists, its refcnt is decrement. If the new filter is not null, its 965 exists, its refcnt is decrement. If the new filter is not null, its
966 refcnt is incremented. The filter is saved/restored, just like the 966 refcnt is incremented. The filter is saved/restored, just like the
967 matrix and clip. 967 matrix and clip.
968 @param filter the new filter (or NULL) 968 @param filter the new filter (or NULL)
969 @return the new filter 969 @return the new filter
970 */ 970 */
971 virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter); 971 virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter);
972 972
973 ////////////////////////////////////////////////////////////////////////// 973 //////////////////////////////////////////////////////////////////////////
974 974
975 /**
976 * Return true if the current clip is empty (i.e. nothing will draw).
977 * Note: this is not always a free call, so it should not be used
978 * more often than necessary. However, once the canvas has computed this
979 * result, subsequent calls will be cheap (until the clip state changes,
980 * which can happen on any clip..() or restore() call.
981 */
982 bool isClipEmpty() const;
983
975 /** Return the current matrix on the canvas. 984 /** Return the current matrix on the canvas.
976 This does not account for the translate in any of the devices. 985 This does not account for the translate in any of the devices.
977 @return The current matrix on the canvas. 986 @return The current matrix on the canvas.
978 */ 987 */
979 const SkMatrix& getTotalMatrix() const; 988 const SkMatrix& getTotalMatrix() const;
980 989
981 enum ClipType { 990 enum ClipType {
982 kEmpty_ClipType = 0, 991 kEmpty_ClipType = 0,
983 kRect_ClipType, 992 kRect_ClipType,
984 kComplex_ClipType 993 kComplex_ClipType
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 bool asROBitmap(SkBitmap*) const; 1300 bool asROBitmap(SkBitmap*) const;
1292 1301
1293 private: 1302 private:
1294 SkBitmap fBitmap; // used if peekPixels() fails 1303 SkBitmap fBitmap; // used if peekPixels() fails
1295 const void* fAddr; // NULL on failure 1304 const void* fAddr; // NULL on failure
1296 SkImageInfo fInfo; 1305 SkImageInfo fInfo;
1297 size_t fRowBytes; 1306 size_t fRowBytes;
1298 }; 1307 };
1299 1308
1300 #endif 1309 #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