| OLD | NEW |
| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 //////////////////////////////////////////////////////////////////////////////// | 70 //////////////////////////////////////////////////////////////////////////////// |
| 71 | 71 |
| 72 bool GrIsBitmapInCache(const GrContext*, const SkBitmap&, const GrTextureParams*
); | 72 bool GrIsBitmapInCache(const GrContext*, const SkBitmap&, const GrTextureParams*
); |
| 73 | 73 |
| 74 GrTexture* GrLockAndRefCachedBitmapTexture(GrContext*, const SkBitmap&, const Gr
TextureParams*); | 74 GrTexture* GrLockAndRefCachedBitmapTexture(GrContext*, const SkBitmap&, const Gr
TextureParams*); |
| 75 | 75 |
| 76 void GrUnlockAndUnrefCachedBitmapTexture(GrTexture*); | 76 void GrUnlockAndUnrefCachedBitmapTexture(GrTexture*); |
| 77 | 77 |
| 78 //////////////////////////////////////////////////////////////////////////////// | 78 //////////////////////////////////////////////////////////////////////////////// |
| 79 |
| 80 class SkGpuDevice; |
| 81 |
| 82 // Converts a SkPaint to a GrPaint, ignoring the SkPaint's shader. |
| 83 // justAlpha indicates that the SkPaint's alpha should be used rather than the c
olor. |
| 84 // Callers may subsequently modify the GrPaint. Setting constantColor indicates |
| 85 // that the final paint will draw the same color at every pixel. This allows |
| 86 // an optimization where the the color filter can be applied to the SkPaint's |
| 87 // color once while converting to GrPaint and then ignored. |
| 88 void SkPaint2GrPaintNoShader(SkGpuDevice* dev, const SkPaint& skPaint, bool just
Alpha, |
| 89 bool constantColor, GrPaint* grPaint); |
| 90 |
| 91 // This function is similar to skPaint2GrPaintNoShader but also converts |
| 92 // skPaint's shader to a GrTexture/GrEffectStage if possible. |
| 93 // constantColor has the same meaning as in skPaint2GrPaintNoShader. |
| 94 void SkPaint2GrPaintShader(SkGpuDevice* dev, const SkPaint& skPaint, |
| 95 bool constantColor, GrPaint* grPaint); |
| 96 |
| 97 //////////////////////////////////////////////////////////////////////////////// |
| 79 // Classes | 98 // Classes |
| 80 | 99 |
| 81 class SkGlyphCache; | 100 class SkGlyphCache; |
| 82 | 101 |
| 83 class SkGrFontScaler : public GrFontScaler { | 102 class SkGrFontScaler : public GrFontScaler { |
| 84 public: | 103 public: |
| 85 explicit SkGrFontScaler(SkGlyphCache* strike); | 104 explicit SkGrFontScaler(SkGlyphCache* strike); |
| 86 virtual ~SkGrFontScaler(); | 105 virtual ~SkGrFontScaler(); |
| 87 | 106 |
| 88 // overrides | 107 // overrides |
| 89 virtual const GrKey* getKey(); | 108 virtual const GrKey* getKey(); |
| 90 virtual GrMaskFormat getMaskFormat(); | 109 virtual GrMaskFormat getMaskFormat(); |
| 91 virtual bool getPackedGlyphBounds(GrGlyph::PackedID, SkIRect* bounds) SK_OVE
RRIDE; | 110 virtual bool getPackedGlyphBounds(GrGlyph::PackedID, SkIRect* bounds) SK_OVE
RRIDE; |
| 92 virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height, | 111 virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height, |
| 93 int rowBytes, void* image) SK_OVERRIDE; | 112 int rowBytes, void* image) SK_OVERRIDE; |
| 94 virtual bool getPackedGlyphDFBounds(GrGlyph::PackedID, SkIRect* bounds) SK_O
VERRIDE; | 113 virtual bool getPackedGlyphDFBounds(GrGlyph::PackedID, SkIRect* bounds) SK_O
VERRIDE; |
| 95 virtual bool getPackedGlyphDFImage(GrGlyph::PackedID, int width, int height, | 114 virtual bool getPackedGlyphDFImage(GrGlyph::PackedID, int width, int height, |
| 96 void* image) SK_OVERRIDE; | 115 void* image) SK_OVERRIDE; |
| 97 virtual bool getGlyphPath(uint16_t glyphID, SkPath*); | 116 virtual bool getGlyphPath(uint16_t glyphID, SkPath*); |
| 98 | 117 |
| 99 private: | 118 private: |
| 100 SkGlyphCache* fStrike; | 119 SkGlyphCache* fStrike; |
| 101 GrKey* fKey; | 120 GrKey* fKey; |
| 102 // DECLARE_INSTANCE_COUNTER(SkGrFontScaler); | 121 // DECLARE_INSTANCE_COUNTER(SkGrFontScaler); |
| 103 }; | 122 }; |
| 104 | 123 |
| 105 //////////////////////////////////////////////////////////////////////////////// | 124 //////////////////////////////////////////////////////////////////////////////// |
| 106 | 125 |
| 107 #endif | 126 #endif |
| OLD | NEW |