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

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

Issue 62163004: Added support for Chrome's gpu command buffer extension BindUniformLocation. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fixed compile error on the bots + feedback. Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.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 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
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 "SkMatrixConvolutionImageFilter.h" 8 #include "SkMatrixConvolutionImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 const GrDrawEffect& drawEffect) { 530 const GrDrawEffect& drawEffect) {
531 const GrMatrixConvolutionEffect& conv = drawEffect.castEffect<GrMatrixConvol utionEffect>(); 531 const GrMatrixConvolutionEffect& conv = drawEffect.castEffect<GrMatrixConvol utionEffect>();
532 GrTexture& texture = *conv.texture(0); 532 GrTexture& texture = *conv.texture(0);
533 // the code we generated was for a specific kernel size 533 // the code we generated was for a specific kernel size
534 SkASSERT(conv.kernelSize() == fKernelSize); 534 SkASSERT(conv.kernelSize() == fKernelSize);
535 SkASSERT(conv.tileMode() == fTileMode); 535 SkASSERT(conv.tileMode() == fTileMode);
536 float imageIncrement[2]; 536 float imageIncrement[2];
537 float ySign = texture.origin() == kTopLeft_GrSurfaceOrigin ? 1.0f : -1.0f; 537 float ySign = texture.origin() == kTopLeft_GrSurfaceOrigin ? 1.0f : -1.0f;
538 imageIncrement[0] = 1.0f / texture.width(); 538 imageIncrement[0] = 1.0f / texture.width();
539 imageIncrement[1] = ySign / texture.height(); 539 imageIncrement[1] = ySign / texture.height();
540 uman.set2fv(fImageIncrementUni, 0, 1, imageIncrement); 540 uman.set2fv(fImageIncrementUni, 1, imageIncrement);
541 uman.set2fv(fTargetUni, 0, 1, conv.target()); 541 uman.set2fv(fTargetUni, 1, conv.target());
542 uman.set1fv(fKernelUni, 0, fKernelSize.width() * fKernelSize.height(), conv. kernel()); 542 uman.set1fv(fKernelUni, fKernelSize.width() * fKernelSize.height(), conv.ker nel());
543 uman.set1f(fGainUni, conv.gain()); 543 uman.set1f(fGainUni, conv.gain());
544 uman.set1f(fBiasUni, conv.bias()); 544 uman.set1f(fBiasUni, conv.bias());
545 const SkIRect& bounds = conv.bounds(); 545 const SkIRect& bounds = conv.bounds();
546 float left = (float) bounds.left() / texture.width(); 546 float left = (float) bounds.left() / texture.width();
547 float top = (float) bounds.top() / texture.height(); 547 float top = (float) bounds.top() / texture.height();
548 float right = (float) bounds.right() / texture.width(); 548 float right = (float) bounds.right() / texture.width();
549 float bottom = (float) bounds.bottom() / texture.height(); 549 float bottom = (float) bounds.bottom() / texture.height();
550 if (texture.origin() == kBottomLeft_GrSurfaceOrigin) { 550 if (texture.origin() == kBottomLeft_GrSurfaceOrigin) {
551 uman.set4f(fBoundsUni, left, 1.0f - bottom, right, 1.0f - top); 551 uman.set4f(fBoundsUni, left, 1.0f - bottom, right, 1.0f - top);
552 } else { 552 } else {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 fBias, 657 fBias,
658 fTarget, 658 fTarget,
659 fTileMode, 659 fTileMode,
660 fConvolveAlpha); 660 fConvolveAlpha);
661 return true; 661 return true;
662 } 662 }
663 663
664 /////////////////////////////////////////////////////////////////////////////// 664 ///////////////////////////////////////////////////////////////////////////////
665 665
666 #endif 666 #endif
OLDNEW
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698