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

Side by Side Diff: src/effects/SkDisplacementMapEffect.cpp

Issue 356513003: Step towards variable length effect keys. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweak comment 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "SkDisplacementMapEffect.h" 8 #include "SkDisplacementMapEffect.h"
9 #include "SkReadBuffer.h" 9 #include "SkReadBuffer.h"
10 #include "SkWriteBuffer.h" 10 #include "SkWriteBuffer.h"
11 #include "SkUnPreMultiply.h" 11 #include "SkUnPreMultiply.h"
12 #include "SkColorPriv.h" 12 #include "SkColorPriv.h"
13 #if SK_SUPPORT_GPU 13 #if SK_SUPPORT_GPU
14 #include "GrContext.h" 14 #include "GrContext.h"
15 #include "GrCoordTransform.h" 15 #include "GrCoordTransform.h"
16 #include "gl/GrGLEffect.h" 16 #include "gl/GrGLEffect.h"
17 #include "gl/GrGLShaderBuilder.h"
17 #include "GrTBackendEffectFactory.h" 18 #include "GrTBackendEffectFactory.h"
18 #endif 19 #endif
19 20
20 namespace { 21 namespace {
21 22
22 #define kChannelSelectorKeyBits 3; // Max value is 4, so 3 bits are required at most 23 #define kChannelSelectorKeyBits 3; // Max value is 4, so 3 bits are required at most
23 24
24 template<SkDisplacementMapEffect::ChannelSelectorType type> 25 template<SkDisplacementMapEffect::ChannelSelectorType type>
25 uint32_t getValue(SkColor, const SkUnPreMultiply::Scale*) { 26 uint32_t getValue(SkColor, const SkUnPreMultiply::Scale*) {
26 SkDEBUGFAIL("Unknown channel selector"); 27 SkDEBUGFAIL("Unknown channel selector");
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 const GrGLCaps&) { 604 const GrGLCaps&) {
604 const GrDisplacementMapEffect& displacementMap = 605 const GrDisplacementMapEffect& displacementMap =
605 drawEffect.castEffect<GrDisplacementMapEffect>(); 606 drawEffect.castEffect<GrDisplacementMapEffect>();
606 607
607 EffectKey xKey = displacementMap.xChannelSelector(); 608 EffectKey xKey = displacementMap.xChannelSelector();
608 EffectKey yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBi ts; 609 EffectKey yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBi ts;
609 610
610 return xKey | yKey; 611 return xKey | yKey;
611 } 612 }
612 #endif 613 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698