OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
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 GrTypesPriv_DEFINED | 8 #ifndef GrTypesPriv_DEFINED |
9 #define GrTypesPriv_DEFINED | 9 #define GrTypesPriv_DEFINED |
10 | 10 |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 * Indicates the type of pending IO operations that can be recorded for gpu reso
urces. | 394 * Indicates the type of pending IO operations that can be recorded for gpu reso
urces. |
395 */ | 395 */ |
396 enum GrIOType { | 396 enum GrIOType { |
397 kRead_GrIOType, | 397 kRead_GrIOType, |
398 kWrite_GrIOType, | 398 kWrite_GrIOType, |
399 kRW_GrIOType | 399 kRW_GrIOType |
400 }; | 400 }; |
401 | 401 |
402 struct GrScissorState { | 402 struct GrScissorState { |
403 GrScissorState() : fEnabled(false) {} | 403 GrScissorState() : fEnabled(false) {} |
| 404 GrScissorState(const SkIRect& rect) : fEnabled(true), fRect(rect) {} |
| 405 void setDisabled() { fEnabled = false; } |
404 void set(const SkIRect& rect) { fRect = rect; fEnabled = true; } | 406 void set(const SkIRect& rect) { fRect = rect; fEnabled = true; } |
| 407 void setNonAA(const SkRect& rect) { rect.round(&fRect); fEnabled = true; } |
405 bool operator==(const GrScissorState& other) const { | 408 bool operator==(const GrScissorState& other) const { |
406 return fEnabled == other.fEnabled && | 409 return fEnabled == other.fEnabled && |
407 (false == fEnabled || fRect == other.fRect); | 410 (false == fEnabled || fRect == other.fRect); |
408 } | 411 } |
409 bool operator!=(const GrScissorState& other) const { return !(*this == other
); } | 412 bool operator!=(const GrScissorState& other) const { return !(*this == other
); } |
410 | 413 |
411 bool enabled() const { return fEnabled; } | 414 bool enabled() const { return fEnabled; } |
412 const SkIRect& rect() const { return fRect; } | 415 const SkIRect& rect() const { return fRect; } |
413 | 416 |
414 private: | 417 private: |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 * Specifies if the holder owns the backend, OpenGL or Vulkan, object. | 471 * Specifies if the holder owns the backend, OpenGL or Vulkan, object. |
469 */ | 472 */ |
470 enum class GrBackendObjectOwnership : bool { | 473 enum class GrBackendObjectOwnership : bool { |
471 /** Holder does not destroy the backend object. */ | 474 /** Holder does not destroy the backend object. */ |
472 kBorrowed = false, | 475 kBorrowed = false, |
473 /** Holder destroys the backend object. */ | 476 /** Holder destroys the backend object. */ |
474 kOwned = true | 477 kOwned = true |
475 }; | 478 }; |
476 | 479 |
477 #endif | 480 #endif |
OLD | NEW |