| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrGLSLProgramDataManager_DEFINED | 8 #ifndef GrGLSLProgramDataManager_DEFINED |
| 9 #define GrGLSLProgramDataManager_DEFINED | 9 #define GrGLSLProgramDataManager_DEFINED |
| 10 | 10 |
| 11 #include "GrResourceHandle.h" | 11 #include "GrResourceHandle.h" |
| 12 #include "SkTypes.h" | 12 #include "SkTypes.h" |
| 13 | 13 |
| 14 class SkMatrix; | 14 class SkMatrix; |
| 15 class SkMatrix44; |
| 15 | 16 |
| 16 /** Manages the resources used by a shader program. | 17 /** Manages the resources used by a shader program. |
| 17 * The resources are objects the program uses to communicate with the | 18 * The resources are objects the program uses to communicate with the |
| 18 * application code. | 19 * application code. |
| 19 */ | 20 */ |
| 20 class GrGLSLProgramDataManager : SkNoncopyable { | 21 class GrGLSLProgramDataManager : SkNoncopyable { |
| 21 public: | 22 public: |
| 22 GR_DEFINE_RESOURCE_HANDLE_CLASS(UniformHandle); | 23 GR_DEFINE_RESOURCE_HANDLE_CLASS(UniformHandle); |
| 23 | 24 |
| 24 virtual ~GrGLSLProgramDataManager() {} | 25 virtual ~GrGLSLProgramDataManager() {} |
| (...skipping 16 matching lines...) Expand all Loading... |
| 41 virtual void setMatrix2f(UniformHandle, const float matrix[]) const = 0; | 42 virtual void setMatrix2f(UniformHandle, const float matrix[]) const = 0; |
| 42 virtual void setMatrix3f(UniformHandle, const float matrix[]) const = 0; | 43 virtual void setMatrix3f(UniformHandle, const float matrix[]) const = 0; |
| 43 virtual void setMatrix4f(UniformHandle, const float matrix[]) const = 0; | 44 virtual void setMatrix4f(UniformHandle, const float matrix[]) const = 0; |
| 44 virtual void setMatrix2fv(UniformHandle, int arrayCount, const float matrice
s[]) const = 0; | 45 virtual void setMatrix2fv(UniformHandle, int arrayCount, const float matrice
s[]) const = 0; |
| 45 virtual void setMatrix3fv(UniformHandle, int arrayCount, const float matrice
s[]) const = 0; | 46 virtual void setMatrix3fv(UniformHandle, int arrayCount, const float matrice
s[]) const = 0; |
| 46 virtual void setMatrix4fv(UniformHandle, int arrayCount, const float matrice
s[]) const = 0; | 47 virtual void setMatrix4fv(UniformHandle, int arrayCount, const float matrice
s[]) const = 0; |
| 47 | 48 |
| 48 // convenience method for uploading a SkMatrix to a 3x3 matrix uniform | 49 // convenience method for uploading a SkMatrix to a 3x3 matrix uniform |
| 49 void setSkMatrix(UniformHandle, const SkMatrix&) const; | 50 void setSkMatrix(UniformHandle, const SkMatrix&) const; |
| 50 | 51 |
| 52 // convenience method for uploading a SkMatrix44 to a 4x4 matrix uniform |
| 53 void setSkMatrix44(UniformHandle, const SkMatrix44&) const; |
| 54 |
| 51 // for nvpr only | 55 // for nvpr only |
| 52 GR_DEFINE_RESOURCE_HANDLE_CLASS(VaryingHandle); | 56 GR_DEFINE_RESOURCE_HANDLE_CLASS(VaryingHandle); |
| 53 virtual void setPathFragmentInputTransform(VaryingHandle u, int components, | 57 virtual void setPathFragmentInputTransform(VaryingHandle u, int components, |
| 54 const SkMatrix& matrix) const = 0
; | 58 const SkMatrix& matrix) const = 0
; |
| 55 | 59 |
| 56 protected: | 60 protected: |
| 57 GrGLSLProgramDataManager() {} | 61 GrGLSLProgramDataManager() {} |
| 58 | 62 |
| 59 private: | 63 private: |
| 60 typedef SkNoncopyable INHERITED; | 64 typedef SkNoncopyable INHERITED; |
| 61 }; | 65 }; |
| 62 | 66 |
| 63 #endif | 67 #endif |
| OLD | NEW |