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

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

Issue 1010343002: add kGray_8_SkColorType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/core/SkMipMap.cpp ('k') | src/pdf/SkPDFImage.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 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 "GrXferProcessor.h" 10 #include "GrXferProcessor.h"
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 return kRGBA_4444_GrPixelConfig; 587 return kRGBA_4444_GrPixelConfig;
588 case kRGBA_8888_SkColorType: 588 case kRGBA_8888_SkColorType:
589 // if (kSRGB_SkColorProfileType == pt) { 589 // if (kSRGB_SkColorProfileType == pt) {
590 // return kSRGBA_8888_GrPixelConfig; 590 // return kSRGBA_8888_GrPixelConfig;
591 // } 591 // }
592 return kRGBA_8888_GrPixelConfig; 592 return kRGBA_8888_GrPixelConfig;
593 case kBGRA_8888_SkColorType: 593 case kBGRA_8888_SkColorType:
594 return kBGRA_8888_GrPixelConfig; 594 return kBGRA_8888_GrPixelConfig;
595 case kIndex_8_SkColorType: 595 case kIndex_8_SkColorType:
596 return kIndex_8_GrPixelConfig; 596 return kIndex_8_GrPixelConfig;
597 case kGray_8_SkColorType:
598 return kAlpha_8_GrPixelConfig; // TODO: gray8 support on gpu
597 } 599 }
598 SkASSERT(0); // shouldn't get here 600 SkASSERT(0); // shouldn't get here
599 return kUnknown_GrPixelConfig; 601 return kUnknown_GrPixelConfig;
600 } 602 }
601 603
602 bool GrPixelConfig2ColorAndProfileType(GrPixelConfig config, SkColorType* ctOut, 604 bool GrPixelConfig2ColorAndProfileType(GrPixelConfig config, SkColorType* ctOut,
603 SkColorProfileType* ptOut) { 605 SkColorProfileType* ptOut) {
604 SkColorType ct; 606 SkColorType ct;
605 SkColorProfileType pt = kLinear_SkColorProfileType; 607 SkColorProfileType pt = kLinear_SkColorProfileType;
606 switch (config) { 608 switch (config) {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol or, &fp) && fp) { 722 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol or, &fp) && fp) {
721 grPaint->addColorProcessor(fp)->unref(); 723 grPaint->addColorProcessor(fp)->unref();
722 constantColor = false; 724 constantColor = false;
723 } 725 }
724 } 726 }
725 727
726 // The grcolor is automatically set when calling asFragmentProcessor. 728 // The grcolor is automatically set when calling asFragmentProcessor.
727 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint. 729 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint.
728 SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantColor, grP aint); 730 SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantColor, grP aint);
729 } 731 }
OLDNEW
« no previous file with comments | « src/core/SkMipMap.cpp ('k') | src/pdf/SkPDFImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698