| 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 |
| 11 #include "GrTypes.h" | 11 #include "GrTypes.h" |
| 12 #include "SkRect.h" | 12 #include "SkRect.h" |
| 13 #include "SkRefCnt.h" |
| 13 | 14 |
| 14 /** | 15 /** |
| 15 * Types of shader-language-specific boxed variables we can create. (Currently
only GrGLShaderVars, | 16 * Types of shader-language-specific boxed variables we can create. (Currently
only GrGLShaderVars, |
| 16 * but should be applicable to other shader languages.) | 17 * but should be applicable to other shader languages.) |
| 17 */ | 18 */ |
| 18 enum GrSLType { | 19 enum GrSLType { |
| 19 kVoid_GrSLType, | 20 kVoid_GrSLType, |
| 20 kFloat_GrSLType, | 21 kFloat_GrSLType, |
| 21 kVec2f_GrSLType, | 22 kVec2f_GrSLType, |
| 22 kVec3f_GrSLType, | 23 kVec3f_GrSLType, |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 /** | 470 /** |
| 470 * Specifies if the holder owns the backend, OpenGL or Vulkan, object. | 471 * Specifies if the holder owns the backend, OpenGL or Vulkan, object. |
| 471 */ | 472 */ |
| 472 enum class GrBackendObjectOwnership : bool { | 473 enum class GrBackendObjectOwnership : bool { |
| 473 /** Holder does not destroy the backend object. */ | 474 /** Holder does not destroy the backend object. */ |
| 474 kBorrowed = false, | 475 kBorrowed = false, |
| 475 /** Holder destroys the backend object. */ | 476 /** Holder destroys the backend object. */ |
| 476 kOwned = true | 477 kOwned = true |
| 477 }; | 478 }; |
| 478 | 479 |
| 480 template <typename T> T * const * sk_sp_address_as_pointer_address(sk_sp<T> cons
t * sp) { |
| 481 static_assert(sizeof(T*) == sizeof(sk_sp<T>), "sk_sp not expected size."); |
| 482 return reinterpret_cast<T * const *>(sp); |
| 483 } |
| 484 |
| 479 #endif | 485 #endif |
| OLD | NEW |