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

Side by Side Diff: src/gpu/effects/GrConfigConversionEffect.h

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 7 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/GrBitmapTextGeoProc.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('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 2012 Google Inc. 2 * Copyright 2012 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 GrConfigConversionEffect_DEFINED 8 #ifndef GrConfigConversionEffect_DEFINED
9 #define GrConfigConversionEffect_DEFINED 9 #define GrConfigConversionEffect_DEFINED
10 10
(...skipping 16 matching lines...) Expand all
27 kNone_PMConversion = 0, 27 kNone_PMConversion = 0,
28 kMulByAlpha_RoundUp_PMConversion, 28 kMulByAlpha_RoundUp_PMConversion,
29 kMulByAlpha_RoundDown_PMConversion, 29 kMulByAlpha_RoundDown_PMConversion,
30 kDivByAlpha_RoundUp_PMConversion, 30 kDivByAlpha_RoundUp_PMConversion,
31 kDivByAlpha_RoundDown_PMConversion, 31 kDivByAlpha_RoundDown_PMConversion,
32 32
33 kPMConversionCnt 33 kPMConversionCnt
34 }; 34 };
35 35
36 static const GrFragmentProcessor* Create(GrTexture*, bool swapRedAndBlue, PM Conversion, 36 static const GrFragmentProcessor* Create(GrTexture*, bool swapRedAndBlue, PM Conversion,
37 const SkMatrix&); 37 const SkMatrix&,
38 GrRenderTarget* dst);
38 39
39 const char* name() const override { return "Config Conversion"; } 40 const char* name() const override { return "Config Conversion"; }
40 41
41 bool swapsRedAndBlue() const { return fSwapRedAndBlue; } 42 bool swapsRedAndBlue() const { return fSwapRedAndBlue; }
42 PMConversion pmConversion() const { return fPMConversion; } 43 PMConversion pmConversion() const { return fPMConversion; }
43 44
44 // This function determines whether it is possible to choose PM->UPM and UPM ->PM conversions 45 // This function determines whether it is possible to choose PM->UPM and UPM ->PM conversions
45 // for which in any PM->UPM->PM->UPM sequence the two UPM values are the sam e. This means that 46 // for which in any PM->UPM->PM->UPM sequence the two UPM values are the sam e. This means that
46 // if pixels are read back to a UPM buffer, written back to PM to the GPU, a nd read back again 47 // if pixels are read back to a UPM buffer, written back to PM to the GPU, a nd read back again
47 // both reads will produce the same result. This test is quite expensive and should not be run 48 // both reads will produce the same result. This test is quite expensive and should not be run
48 // multiple times for a given context. 49 // multiple times for a given context.
49 static void TestForPreservingPMConversions(GrContext* context, 50 static void TestForPreservingPMConversions(GrContext* context,
50 PMConversion* PMToUPMRule, 51 PMConversion* PMToUPMRule,
51 PMConversion* UPMToPMRule); 52 PMConversion* UPMToPMRule);
52 53
53 private: 54 private:
54 GrConfigConversionEffect(GrTexture*, 55 GrConfigConversionEffect(GrTexture*,
55 bool swapRedAndBlue, 56 bool swapRedAndBlue,
56 PMConversion pmConversion, 57 PMConversion pmConversion,
57 const SkMatrix& matrix); 58 const SkMatrix& matrix, GrRenderTarget* dst);
58 59
59 GrGLFragmentProcessor* onCreateGLInstance() const override; 60 GrGLFragmentProcessor* onCreateGLInstance() const override;
60 61
61 void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const ov erride; 62 void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const ov erride;
62 63
63 bool onIsEqual(const GrFragmentProcessor&) const override; 64 bool onIsEqual(const GrFragmentProcessor&) const override;
64 65
65 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; 66 void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
66 67
67 bool fSwapRedAndBlue; 68 bool fSwapRedAndBlue;
68 PMConversion fPMConversion; 69 PMConversion fPMConversion;
69 70
70 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 71 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
71 72
72 typedef GrSingleTextureEffect INHERITED; 73 typedef GrSingleTextureEffect INHERITED;
73 }; 74 };
74 75
75 #endif 76 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBitmapTextGeoProc.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698