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

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

Issue 787233003: Add XP to handle the cases where we disable color write. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 6 years 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/GrDisableColorXP.h ('k') | src/gpu/effects/GrPorterDuffXferProcessor.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 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 #include "effects/GrDisableColorXP.h"
9 #include "GrProcessor.h"
10 #include "gl/GrGLXferProcessor.h"
11
12 class GrGLDisableColorXP : public GrGLXferProcessor {
13 public:
14 GrGLDisableColorXP(const GrProcessor&) {}
15
16 ~GrGLDisableColorXP() SK_OVERRIDE {}
17
18 void emitCode(const EmitArgs& args) SK_OVERRIDE {}
19
20 void setData(const GrGLProgramDataManager&, const GrXferProcessor&) SK_OVERR IDE {}
21
22 static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilde r*) {}
23
24 private:
25 typedef GrGLXferProcessor INHERITED;
26 };
27
28 ///////////////////////////////////////////////////////////////////////////////
29
30 GrDisableColorXP::GrDisableColorXP() {
31 this->initClassID<GrDisableColorXP>();
32 }
33
34 void GrDisableColorXP::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBui lder* b) const {
35 GrGLDisableColorXP::GenKey(*this, caps, b);
36 }
37
38 GrGLXferProcessor* GrDisableColorXP::createGLInstance() const {
39 return SkNEW_ARGS(GrGLDisableColorXP, (*this));
40 }
41
42 void GrDisableColorXP::getBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const {
43 blendInfo->fWriteColor = false;
44 }
45
46 ///////////////////////////////////////////////////////////////////////////////
47
48 GrDisableColorXPFactory::GrDisableColorXPFactory() {
49 this->initClassID<GrDisableColorXPFactory>();
50 }
51
52 GrXferProcessor* GrDisableColorXPFactory::createXferProcessor(const GrProcOptInf o& colorPOI,
53 const GrProcOptInf o& covPOI) const {
54 return GrDisableColorXP::Create();
55 }
56
57 GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory);
58
59 GrXPFactory* GrDisableColorXPFactory::TestCreate(SkRandom* random,
60 GrContext*,
61 const GrDrawTargetCaps&,
62 GrTexture*[]) {
63 return GrDisableColorXPFactory::Create();
64 }
65
OLDNEW
« no previous file with comments | « src/gpu/effects/GrDisableColorXP.h ('k') | src/gpu/effects/GrPorterDuffXferProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698