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

Side by Side Diff: include/gpu/GrStagedProcessor.h

Issue 1229303003: Another trivial cleanup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more minor Created 5 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
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrStagedProcessorStage_DEFINED
9 #define GrStagedProcessorStage_DEFINED
10
11 #include "GrFragmentProcessor.h"
12 #include "SkRefCnt.h"
13
14 /**
robertphillips 2015/07/13 19:12:29 Update comment ? // templatized based on which con
15 * Wraps a GrFragmentProcessor, basically a copyable SkAutoTUnref
16 */
17 template<template<typename> class T>
18 class GrStagedProcessor {
19 public:
20 explicit GrStagedProcessor(const GrFragmentProcessor* proc) : fProc(SkRef(pr oc)) {}
21
22 GrStagedProcessor(const GrStagedProcessor& other) { fProc.reset(SkRef(other. fProc.get())); }
23
24 const GrFragmentProcessor* processor() const { return fProc.get(); }
25
26 bool operator==(const GrStagedProcessor& that) const {
27 return this->processor() == that.processor();
28 }
29
30 bool operator!=(const GrStagedProcessor& that) const { return !(*this == tha t); }
31
32 const char* name() const { return fProc->name(); }
33
34 protected:
35 T<const GrFragmentProcessor> fProc;
36 };
37
robertphillips 2015/07/13 19:12:29 Can we not do: typedef GrStagedProcessor<GrPending
38 typedef GrStagedProcessor<SkAutoTUnref> GrFragmentStage;
39
40 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698