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

Side by Side Diff: src/gpu/effects/GrConvexPolyEffect.cpp

Issue 371103003: Remove GrEffect::CreateEffectRef and GrEffect::AutoEffectRef. (Closed) Base URL: https://skia.googlesource.com/skia.git@no_ref2
Patch Set: Address comments and update for new YUV effect Created 6 years, 5 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
« no previous file with comments | « src/gpu/effects/GrConvexPolyEffect.h ('k') | src/gpu/effects/GrConvolutionEffect.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "GrConvexPolyEffect.h" 8 #include "GrConvexPolyEffect.h"
9 9
10 #include "gl/GrGLEffect.h" 10 #include "gl/GrGLEffect.h"
11 #include "gl/GrGLSL.h" 11 #include "gl/GrGLSL.h"
12 #include "GrTBackendEffectFactory.h" 12 #include "GrTBackendEffectFactory.h"
13 13
14 #include "SkPath.h" 14 #include "SkPath.h"
15 15
16 ////////////////////////////////////////////////////////////////////////////// 16 //////////////////////////////////////////////////////////////////////////////
17 class GLAARectEffect; 17 class GLAARectEffect;
18 18
19 class AARectEffect : public GrEffect { 19 class AARectEffect : public GrEffect {
20 public: 20 public:
21 typedef GLAARectEffect GLEffect; 21 typedef GLAARectEffect GLEffect;
22 22
23 const SkRect& getRect() const { return fRect; } 23 const SkRect& getRect() const { return fRect; }
24 24
25 static const char* Name() { return "AARect"; } 25 static const char* Name() { return "AARect"; }
26 26
27 static GrEffectRef* Create(GrEffectEdgeType edgeType, const SkRect& rect) { 27 static GrEffectRef* Create(GrEffectEdgeType edgeType, const SkRect& rect) {
28 return CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(AARectEffect, (edgeTyp e, rect)))); 28 return SkNEW_ARGS(AARectEffect, (edgeType, rect));
29 } 29 }
30 30
31 virtual void getConstantColorComponents(GrColor* color, 31 virtual void getConstantColorComponents(GrColor* color,
32 uint32_t* validFlags) const SK_OVERR IDE { 32 uint32_t* validFlags) const SK_OVERR IDE {
33 if (fRect.isEmpty()) { 33 if (fRect.isEmpty()) {
34 // An empty rect will have no coverage anywhere. 34 // An empty rect will have no coverage anywhere.
35 *color = 0x00000000; 35 *color = 0x00000000;
36 *validFlags = kRGBA_GrColorComponentFlags; 36 *validFlags = kRGBA_GrColorComponentFlags;
37 } else { 37 } else {
38 *validFlags = 0; 38 *validFlags = 0;
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 } 365 }
366 366
367 GrEffectRef* effect; 367 GrEffectRef* effect;
368 do { 368 do {
369 GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>( 369 GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>(
370 random->nextULessThan(kGrEffectEdgeTypeC nt)); 370 random->nextULessThan(kGrEffectEdgeTypeC nt));
371 effect = GrConvexPolyEffect::Create(edgeType, count, edges); 371 effect = GrConvexPolyEffect::Create(edgeType, count, edges);
372 } while (NULL == effect); 372 } while (NULL == effect);
373 return effect; 373 return effect;
374 } 374 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConvexPolyEffect.h ('k') | src/gpu/effects/GrConvolutionEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698