OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrXferProcessor_DEFINED | 8 #ifndef GrXferProcessor_DEFINED |
9 #define GrXferProcessor_DEFINED | 9 #define GrXferProcessor_DEFINED |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 DstTexture(const DstTexture& other) { | 63 DstTexture(const DstTexture& other) { |
64 *this = other; | 64 *this = other; |
65 } | 65 } |
66 | 66 |
67 DstTexture(GrTexture* texture, const SkIPoint& offset) | 67 DstTexture(GrTexture* texture, const SkIPoint& offset) |
68 : fTexture(SkSafeRef(texture)) | 68 : fTexture(SkSafeRef(texture)) |
69 , fOffset(offset) { | 69 , fOffset(offset) { |
70 } | 70 } |
71 | 71 |
72 DstTexture& operator=(const DstTexture& other) { | 72 DstTexture& operator=(const DstTexture& other) { |
73 fTexture.reset(SkSafeRef(other.fTexture.get())); | 73 fTexture = other.fTexture; |
74 fOffset = other.fOffset; | 74 fOffset = other.fOffset; |
75 return *this; | 75 return *this; |
76 } | 76 } |
77 | 77 |
78 const SkIPoint& offset() const { return fOffset; } | 78 const SkIPoint& offset() const { return fOffset; } |
79 | 79 |
80 void setOffset(const SkIPoint& offset) { fOffset = offset; } | 80 void setOffset(const SkIPoint& offset) { fOffset = offset; } |
81 void setOffset(int ox, int oy) { fOffset.set(ox, oy); } | 81 void setOffset(int ox, int oy) { fOffset.set(ox, oy); } |
82 | 82 |
83 GrTexture* texture() const { return fTexture.get(); } | 83 GrTexture* texture() const { return fTexture.get(); } |
84 | 84 |
85 GrTexture* setTexture(GrTexture* texture) { | 85 void setTexture(sk_sp<GrTexture> texture) { |
86 fTexture.reset(SkSafeRef(texture)); | 86 fTexture = std::move(texture); |
87 return texture; | |
88 } | 87 } |
89 | 88 |
90 private: | 89 private: |
91 SkAutoTUnref<GrTexture> fTexture; | 90 sk_sp<GrTexture> fTexture; |
92 SkIPoint fOffset; | 91 SkIPoint fOffset; |
93 }; | 92 }; |
94 | 93 |
95 /** | 94 /** |
96 * Sets a unique key on the GrProcessorKeyBuilder calls onGetGLSLProcessorKe
y(...) to get the | 95 * Sets a unique key on the GrProcessorKeyBuilder calls onGetGLSLProcessorKe
y(...) to get the |
97 * specific subclass's key. | 96 * specific subclass's key. |
98 */ | 97 */ |
99 void getGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c
onst; | 98 void getGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c
onst; |
100 | 99 |
101 /** Returns a new instance of the appropriate *GL* implementation class | 100 /** Returns a new instance of the appropriate *GL* implementation class |
102 for the given GrXferProcessor; caller is responsible for deleting | 101 for the given GrXferProcessor; caller is responsible for deleting |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 enum { | 378 enum { |
380 kIllegalXPFClassID = 0, | 379 kIllegalXPFClassID = 0, |
381 }; | 380 }; |
382 static int32_t gCurrXPFClassID; | 381 static int32_t gCurrXPFClassID; |
383 | 382 |
384 typedef GrProgramElement INHERITED; | 383 typedef GrProgramElement INHERITED; |
385 }; | 384 }; |
386 | 385 |
387 #endif | 386 #endif |
388 | 387 |
OLD | NEW |