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

Side by Side Diff: src/gpu/SkGr.cpp

Issue 1225673007: Initial CL to create dummy GrShaderDataManager and thread it through (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 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 2010 Google Inc. 2 * Copyright 2010 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 "SkGr.h" 8 #include "SkGr.h"
9 9
10 #include "GrCaps.h" 10 #include "GrCaps.h"
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 763
764 GrColor paintColor = SkColor2GrColor(skPaint.getColor()); 764 GrColor paintColor = SkColor2GrColor(skPaint.getColor());
765 765
766 // Start a new block here in order to preserve our context state after calli ng 766 // Start a new block here in order to preserve our context state after calli ng
767 // asFragmentProcessor(). Since these calls get passed back to the client, w e don't really 767 // asFragmentProcessor(). Since these calls get passed back to the client, w e don't really
768 // want them messing around with the context. 768 // want them messing around with the context.
769 { 769 {
770 // Allow the shader to modify paintColor and also create an effect to be installed as 770 // Allow the shader to modify paintColor and also create an effect to be installed as
771 // the first color effect on the GrPaint. 771 // the first color effect on the GrPaint.
772 GrFragmentProcessor* fp = NULL; 772 GrFragmentProcessor* fp = NULL;
773 if (!shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCo lor, &fp)) { 773 if (!shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCo lor,
774 grPaint->getShaderDataManager(), &fp)) {
774 return false; 775 return false;
775 } 776 }
776 if (fp) { 777 if (fp) {
777 grPaint->addColorProcessor(fp)->unref(); 778 grPaint->addColorProcessor(fp)->unref();
778 constantColor = false; 779 constantColor = false;
779 } 780 }
780 } 781 }
781 782
782 // The grcolor is automatically set when calling asFragmentProcessor. 783 // The grcolor is automatically set when calling asFragmentProcessor.
783 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint. 784 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint.
(...skipping 14 matching lines...) Expand all
798 } 799 }
799 return SkImageInfo::Make(w, h, ct, at); 800 return SkImageInfo::Make(w, h, ct, at);
800 } 801 }
801 802
802 803
803 void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, SkBitmap * dst) { 804 void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, SkBitmap * dst) {
804 const SkImageInfo info = GrMakeInfoFromTexture(src, w, h, isOpaque); 805 const SkImageInfo info = GrMakeInfoFromTexture(src, w, h, isOpaque);
805 dst->setInfo(info); 806 dst->setInfo(info);
806 dst->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, src)))->unref(); 807 dst->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, src)))->unref();
807 } 808 }
OLDNEW
« include/gpu/GrShaderDataManager.h ('K') | « src/gpu/GrShaderDataManager.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698