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

Side by Side Diff: include/gpu/SkGr.h

Issue 45363002: Fix for issue 1728: raster vs. gpu text draws with the wrong color (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Missed a color conversion 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 static inline GrColor SkColor2GrColor(SkColor c) { 54 static inline GrColor SkColor2GrColor(SkColor c) {
55 SkPMColor pm = SkPreMultiplyColor(c); 55 SkPMColor pm = SkPreMultiplyColor(c);
56 unsigned r = SkGetPackedR32(pm); 56 unsigned r = SkGetPackedR32(pm);
57 unsigned g = SkGetPackedG32(pm); 57 unsigned g = SkGetPackedG32(pm);
58 unsigned b = SkGetPackedB32(pm); 58 unsigned b = SkGetPackedB32(pm);
59 unsigned a = SkGetPackedA32(pm); 59 unsigned a = SkGetPackedA32(pm);
60 return GrColorPackRGBA(r, g, b, a); 60 return GrColorPackRGBA(r, g, b, a);
61 } 61 }
62 62
63 static inline GrColor SkColor2GrColorNoPremultiply(SkColor c) {
64 unsigned r = SkColorGetR(c);
65 unsigned g = SkColorGetG(c);
66 unsigned b = SkColorGetB(c);
67 unsigned a = SkColorGetA(c);
68 return GrColorPackRGBA(r, g, b, a);
69 }
70
63 //////////////////////////////////////////////////////////////////////////////// 71 ////////////////////////////////////////////////////////////////////////////////
64 72
65 bool GrIsBitmapInCache(const GrContext*, const SkBitmap&, const GrTextureParams* ); 73 bool GrIsBitmapInCache(const GrContext*, const SkBitmap&, const GrTextureParams* );
66 74
67 GrTexture* GrLockAndRefCachedBitmapTexture(GrContext*, const SkBitmap&, const Gr TextureParams*); 75 GrTexture* GrLockAndRefCachedBitmapTexture(GrContext*, const SkBitmap&, const Gr TextureParams*);
68 76
69 void GrUnlockAndUnrefCachedBitmapTexture(GrTexture*); 77 void GrUnlockAndUnrefCachedBitmapTexture(GrTexture*);
70 78
71 //////////////////////////////////////////////////////////////////////////////// 79 ////////////////////////////////////////////////////////////////////////////////
72 // Classes 80 // Classes
(...skipping 15 matching lines...) Expand all
88 96
89 private: 97 private:
90 SkGlyphCache* fStrike; 98 SkGlyphCache* fStrike;
91 GrKey* fKey; 99 GrKey* fKey;
92 // DECLARE_INSTANCE_COUNTER(SkGrFontScaler); 100 // DECLARE_INSTANCE_COUNTER(SkGrFontScaler);
93 }; 101 };
94 102
95 //////////////////////////////////////////////////////////////////////////////// 103 ////////////////////////////////////////////////////////////////////////////////
96 104
97 #endif 105 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698