Chromium Code Reviews| 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. | |
| 370 * | |
| 371 * @param bounds A bounds on the geometry that will be drawn through the c lip. The clip only | |
|
robertphillips
2016/08/26 14:00:43
instersection ?
bsalomon
2016/08/26 14:19:18
Done.
| |
| 372 * need be equivalent to a instersection with a rrect within the bounds. | |
| 373 * @param rrect If return is true rrect will contain the rrect equivalent to the stack. | |
| 374 * @param aa If return is true aa will indicate whether the equivalent rrect clip is | |
| 375 * antialiased. | |
| 376 * @return true if the stack is equivalent to a single rrect intersect clip, false otherwise. | |
| 377 */ | |
| 378 bool isRRect(const SkRect& bounds, SkRRect* rrect, bool* aa) const; | |
| 379 | |
| 380 /** | |
| 368 * The generation ID has three reserved values to indicate special | 381 * The generation ID has three reserved values to indicate special |
| 369 * (potentially ignorable) cases | 382 * (potentially ignorable) cases |
| 370 */ | 383 */ |
| 371 static const int32_t kInvalidGenID = 0; //!< Invalid id that is never re turned by | 384 static const int32_t kInvalidGenID = 0; //!< Invalid id that is never re turned by |
| 372 //!< SkClipStack. Useful when ca ching clips | 385 //!< SkClipStack. Useful when ca ching clips |
| 373 //!< based on GenID. | 386 //!< based on GenID. |
| 374 static const int32_t kEmptyGenID = 1; // no pixels writeable | 387 static const int32_t kEmptyGenID = 1; // no pixels writeable |
| 375 static const int32_t kWideOpenGenID = 2; // all pixels writeable | 388 static const int32_t kWideOpenGenID = 2; // all pixels writeable |
| 376 | 389 |
| 377 int32_t getTopmostGenID() const; | 390 int32_t getTopmostGenID() const; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 497 */ | 510 */ |
| 498 void restoreTo(int saveCount); | 511 void restoreTo(int saveCount); |
| 499 | 512 |
| 500 /** | 513 /** |
| 501 * Return the next unique generation ID. | 514 * Return the next unique generation ID. |
| 502 */ | 515 */ |
| 503 static int32_t GetNextGenID(); | 516 static int32_t GetNextGenID(); |
| 504 }; | 517 }; |
| 505 | 518 |
| 506 #endif | 519 #endif |
| OLD | NEW |