| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #ifndef SkClipStack_DEFINED | 8 #ifndef SkClipStack_DEFINED |
| 9 #define SkClipStack_DEFINED | 9 #define SkClipStack_DEFINED |
| 10 | 10 |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 // An optimized version of clipDevRect(emptyRect, kIntersect, ...) | 358 // An optimized version of clipDevRect(emptyRect, kIntersect, ...) |
| 359 void clipEmpty(); | 359 void clipEmpty(); |
| 360 | 360 |
| 361 /** | 361 /** |
| 362 * isWideOpen returns true if the clip state corresponds to the infinite | 362 * isWideOpen returns true if the clip state corresponds to the infinite |
| 363 * plane (i.e., draws are not limited at all) | 363 * plane (i.e., draws are not limited at all) |
| 364 */ | 364 */ |
| 365 bool isWideOpen() const { return this->getTopmostGenID() == kWideOpenGenID;
} | 365 bool isWideOpen() const { return this->getTopmostGenID() == kWideOpenGenID;
} |
| 366 | 366 |
| 367 /** | 367 /** |
| 368 * This method quickly and conservatively determines whether the entire stac
k is equivalent to |
| 369 * intersection with a rrect given a bounds, where the rrect must not contai
n the entire bounds. |
| 370 * |
| 371 * @param bounds A bounds on what will be drawn through the clip. The clip
only need be |
| 372 * equivalent to a intersection with a rrect for draws withi
n the bounds. The |
| 373 * returned rrect must intersect the bounds but need not be
contained by the |
| 374 * bounds. |
| 375 * @param rrect If return is true rrect will contain the rrect equivalent
to the stack. |
| 376 * @param aa If return is true aa will indicate whether the equivalent
rrect clip is |
| 377 * antialiased. |
| 378 * @return true if the stack is equivalent to a single rrect intersect clip,
false otherwise. |
| 379 */ |
| 380 bool isRRect(const SkRect& bounds, SkRRect* rrect, bool* aa) const; |
| 381 |
| 382 /** |
| 368 * The generation ID has three reserved values to indicate special | 383 * The generation ID has three reserved values to indicate special |
| 369 * (potentially ignorable) cases | 384 * (potentially ignorable) cases |
| 370 */ | 385 */ |
| 371 static const int32_t kInvalidGenID = 0; //!< Invalid id that is never re
turned by | 386 static const int32_t kInvalidGenID = 0; //!< Invalid id that is never re
turned by |
| 372 //!< SkClipStack. Useful when ca
ching clips | 387 //!< SkClipStack. Useful when ca
ching clips |
| 373 //!< based on GenID. | 388 //!< based on GenID. |
| 374 static const int32_t kEmptyGenID = 1; // no pixels writeable | 389 static const int32_t kEmptyGenID = 1; // no pixels writeable |
| 375 static const int32_t kWideOpenGenID = 2; // all pixels writeable | 390 static const int32_t kWideOpenGenID = 2; // all pixels writeable |
| 376 | 391 |
| 377 int32_t getTopmostGenID() const; | 392 int32_t getTopmostGenID() const; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 */ | 512 */ |
| 498 void restoreTo(int saveCount); | 513 void restoreTo(int saveCount); |
| 499 | 514 |
| 500 /** | 515 /** |
| 501 * Return the next unique generation ID. | 516 * Return the next unique generation ID. |
| 502 */ | 517 */ |
| 503 static int32_t GetNextGenID(); | 518 static int32_t GetNextGenID(); |
| 504 }; | 519 }; |
| 505 | 520 |
| 506 #endif | 521 #endif |
| OLD | NEW |