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

Side by Side Diff: Source/platform/graphics/filters/FELighting.h

Issue 181943003: Scaling and offset fix for FELighting (software and skia paths) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 (C) 2010 University of Szeged 2 * Copyright (C) 2010 University of Szeged
3 * Copyright (C) 2010 Zoltan Herczeg 3 * Copyright (C) 2010 Zoltan Herczeg
4 * Copyright (C) 2013 Google Inc. All rights reserved. 4 * Copyright (C) 2013 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 SpecularLighting 54 SpecularLighting
55 }; 55 };
56 56
57 struct LightingData { 57 struct LightingData {
58 // This structure contains only read-only (SMP safe) data 58 // This structure contains only read-only (SMP safe) data
59 Uint8ClampedArray* pixels; 59 Uint8ClampedArray* pixels;
60 float surfaceScale; 60 float surfaceScale;
61 int widthMultipliedByPixelSize; 61 int widthMultipliedByPixelSize;
62 int widthDecreasedByOne; 62 int widthDecreasedByOne;
63 int heightDecreasedByOne; 63 int heightDecreasedByOne;
64 FloatSize originOffset;
65 FloatPoint3D worldScale;
64 66
65 inline void topLeft(int offset, IntPoint& normalVector); 67 inline void topLeft(int offset, IntPoint& normalVector);
66 inline void topRow(int offset, IntPoint& normalVector); 68 inline void topRow(int offset, IntPoint& normalVector);
67 inline void topRight(int offset, IntPoint& normalVector); 69 inline void topRight(int offset, IntPoint& normalVector);
68 inline void leftColumn(int offset, IntPoint& normalVector); 70 inline void leftColumn(int offset, IntPoint& normalVector);
69 inline void interior(int offset, IntPoint& normalVector); 71 inline void interior(int offset, IntPoint& normalVector);
70 inline void rightColumn(int offset, IntPoint& normalVector); 72 inline void rightColumn(int offset, IntPoint& normalVector);
71 inline void bottomLeft(int offset, IntPoint& normalVector); 73 inline void bottomLeft(int offset, IntPoint& normalVector);
72 inline void bottomRow(int offset, IntPoint& normalVector); 74 inline void bottomRow(int offset, IntPoint& normalVector);
73 inline void bottomRight(int offset, IntPoint& normalVector); 75 inline void bottomRight(int offset, IntPoint& normalVector);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 float m_surfaceScale; 117 float m_surfaceScale;
116 float m_diffuseConstant; 118 float m_diffuseConstant;
117 float m_specularConstant; 119 float m_specularConstant;
118 float m_specularExponent; 120 float m_specularExponent;
119 float m_kernelUnitLengthX; 121 float m_kernelUnitLengthX;
120 float m_kernelUnitLengthY; 122 float m_kernelUnitLengthY;
121 123
122 private: 124 private:
123 virtual void applySoftware() OVERRIDE; 125 virtual void applySoftware() OVERRIDE;
124 virtual bool applySkia() OVERRIDE; 126 virtual bool applySkia() OVERRIDE;
127
128 void getTransform(FloatSize* offset, FloatPoint3D* scale) const;
125 }; 129 };
126 130
127 } // namespace WebCore 131 } // namespace WebCore
128 132
129 #endif // FELighting_h 133 #endif // FELighting_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698