Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: src/core/SkShader.cpp

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make it run. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 #include "SkAtomics.h" 8 #include "SkAtomics.h"
9 #include "SkBitmapProcShader.h" 9 #include "SkBitmapProcShader.h"
10 #include "SkColorShader.h" 10 #include "SkColorShader.h"
11 #include "SkEmptyShader.h" 11 #include "SkEmptyShader.h"
12 #include "SkMallocPixelRef.h" 12 #include "SkMallocPixelRef.h"
13 #include "SkPaint.h" 13 #include "SkPaint.h"
14 #include "SkPicture.h" 14 #include "SkPicture.h"
15 #include "SkPictureShader.h" 15 #include "SkPictureShader.h"
16 #include "SkReadBuffer.h" 16 #include "SkReadBuffer.h"
17 #include "SkScalar.h" 17 #include "SkScalar.h"
18 #include "SkShader.h" 18 #include "SkShader.h"
19 #include "SkWriteBuffer.h" 19 #include "SkWriteBuffer.h"
20 20
21 #include "GrFragmentProcessor.h"
bungeman-skia 2016/06/08 18:22:16 Hmmm... not sure this is valid in a cpp file witho
bsalomon 2016/06/08 19:50:50 I suppose that if this is a problem we could do a
22
21 //#define SK_TRACK_SHADER_LIFETIME 23 //#define SK_TRACK_SHADER_LIFETIME
22 24
23 #ifdef SK_TRACK_SHADER_LIFETIME 25 #ifdef SK_TRACK_SHADER_LIFETIME
24 static int32_t gShaderCounter; 26 static int32_t gShaderCounter;
25 #endif 27 #endif
26 28
27 static inline void inc_shader_counter() { 29 static inline void inc_shader_counter() {
28 #ifdef SK_TRACK_SHADER_LIFETIME 30 #ifdef SK_TRACK_SHADER_LIFETIME
29 int32_t prev = sk_atomic_inc(&gShaderCounter); 31 int32_t prev = sk_atomic_inc(&gShaderCounter);
30 SkDebugf("+++ shader counter %d\n", prev + 1); 32 SkDebugf("+++ shader counter %d\n", prev + 1);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 215 }
214 return mc; 216 return mc;
215 } 217 }
216 218
217 ////////////////////////////////////////////////////////////////////////////// 219 //////////////////////////////////////////////////////////////////////////////
218 220
219 SkShader::GradientType SkShader::asAGradient(GradientInfo* info) const { 221 SkShader::GradientType SkShader::asAGradient(GradientInfo* info) const {
220 return kNone_GradientType; 222 return kNone_GradientType;
221 } 223 }
222 224
223 const GrFragmentProcessor* SkShader::asFragmentProcessor(GrContext*, const SkMat rix&, 225 sk_sp<GrFragmentProcessor> SkShader::asFragmentProcessor(GrContext*, const SkMat rix&,
224 const SkMatrix*, SkFilt erQuality, 226 const SkMatrix*, SkFilt erQuality,
225 SkSourceGammaTreatment) const { 227 SkSourceGammaTreatment) const {
226 return nullptr; 228 return nullptr;
227 } 229 }
228 230
229 SkShader* SkShader::refAsALocalMatrixShader(SkMatrix*) const { 231 SkShader* SkShader::refAsALocalMatrixShader(SkMatrix*) const {
230 return nullptr; 232 return nullptr;
231 } 233 }
232 234
233 sk_sp<SkShader> SkShader::MakeEmptyShader() { return sk_make_sp<SkEmptyShader>() ; } 235 sk_sp<SkShader> SkShader::MakeEmptyShader() { return sk_make_sp<SkEmptyShader>() ; }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 } 292 }
291 #endif 293 #endif
292 294
293 #ifdef SK_SUPPORT_LEGACY_XFERMODE_PTR 295 #ifdef SK_SUPPORT_LEGACY_XFERMODE_PTR
294 #include "SkXfermode.h" 296 #include "SkXfermode.h"
295 sk_sp<SkShader> SkShader::MakeComposeShader(sk_sp<SkShader> dst, sk_sp<SkShader> src, 297 sk_sp<SkShader> SkShader::MakeComposeShader(sk_sp<SkShader> dst, sk_sp<SkShader> src,
296 SkXfermode* xfer) { 298 SkXfermode* xfer) {
297 return MakeComposeShader(std::move(dst), std::move(src), sk_ref_sp(xfer)); 299 return MakeComposeShader(std::move(dst), std::move(src), sk_ref_sp(xfer));
298 } 300 }
299 #endif 301 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698