Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(69)

Unified Diff: gpu/src/GrGpuGLShaders.cpp

Issue 4517126: Correction of texture domain bounds. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Correct arg types to setXYWH. Created 14 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | samplecode/SampleTextureDomain.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/src/GrGpuGLShaders.cpp
===================================================================
--- gpu/src/GrGpuGLShaders.cpp (revision 1476)
+++ gpu/src/GrGpuGLShaders.cpp (working copy)
@@ -342,20 +342,19 @@
void GrGpuGLShaders::flushTextureDomain(int s) {
const GrGLint& uni = fProgramData->fUniLocations.fStages[s].fTexDomUni;
if (GrGLProgram::kUnusedUniform != uni) {
- const GrRect &texDom =
+ const GrRect &texDom =
fCurrDrawState.fSamplerStates[s].getTextureDomain();
- if (((1 << s) & fDirtyFlags.fTextureChangedMask) ||
- fProgramData->fTextureDomain[s] != texDom)
+ if (((1 << s) & fDirtyFlags.fTextureChangedMask) ||
+ fProgramData->fTextureDomain[s] != texDom) {
- {
fProgramData->fTextureDomain[s] = texDom;
float values[4] = {
- GrScalarToFloat(texDom.left()),
- GrScalarToFloat(texDom.top()),
- GrScalarToFloat(texDom.right()),
- GrScalarToFloat(texDom.bottom())
+ GrScalarToFloat(texDom.left()),
+ GrScalarToFloat(texDom.top()),
+ GrScalarToFloat(texDom.right()),
+ GrScalarToFloat(texDom.bottom())
};
GrGLTexture* texture = (GrGLTexture*) fCurrDrawState.fTextures[s];
@@ -365,6 +364,9 @@
if (GrGLTexture::kBottomUp_Orientation == orientation) {
values[1] = 1.0f - values[1];
values[3] = 1.0f - values[3];
+ // The top and bottom were just flipped, so correct the ordering
+ // of elements so that values = (l, t, r, b).
+ SkTSwap(values[1], values[3]);
}
values[0] *= SkScalarToFloat(texture->contentScaleX());
« no previous file with comments | « no previous file | samplecode/SampleTextureDomain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b