Chromium Code Reviews| 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 | |
|
robertphillips
2014/05/13 16:24:11
converts -> Converts ?
"skPaint's shader" -> "SkPa
egdaniel
2014/05/13 17:35:54
As of now we always fall back to src-over for the
| |
| 82 // converts a SkPaint to a GrPaint, ignoring the skPaint's shader | |
| 83 // justAlpha indicates that skPaint's alpha should be used rather than the color | |
| 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 bool 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. The texture to | |
|
robertphillips
2014/05/13 16:24:11
There is no param 'act'
Add "Return true on succes
| |
| 93 // be used is set on grPaint and returned in param act. constantColor has the | |
| 94 // same meaning as in skPaint2GrPaintNoShader. | |
| 95 bool SkPaint2GrPaintShader(SkGpuDevice* dev, const SkPaint& skPaint, | |
| 96 bool constantColor, GrPaint* grPaint); | |
| 97 | |
| 98 //////////////////////////////////////////////////////////////////////////////// | |
| 79 // Classes | 99 // Classes |
| 80 | 100 |
| 81 class SkGlyphCache; | 101 class SkGlyphCache; |
| 82 | 102 |
| 83 class SkGrFontScaler : public GrFontScaler { | 103 class SkGrFontScaler : public GrFontScaler { |
| 84 public: | 104 public: |
| 85 explicit SkGrFontScaler(SkGlyphCache* strike); | 105 explicit SkGrFontScaler(SkGlyphCache* strike); |
| 86 virtual ~SkGrFontScaler(); | 106 virtual ~SkGrFontScaler(); |
| 87 | 107 |
| 88 // overrides | 108 // overrides |
| 89 virtual const GrKey* getKey(); | 109 virtual const GrKey* getKey(); |
| 90 virtual GrMaskFormat getMaskFormat(); | 110 virtual GrMaskFormat getMaskFormat(); |
| 91 virtual bool getPackedGlyphBounds(GrGlyph::PackedID, SkIRect* bounds) SK_OVE RRIDE; | 111 virtual bool getPackedGlyphBounds(GrGlyph::PackedID, SkIRect* bounds) SK_OVE RRIDE; |
| 92 virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height, | 112 virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height, |
| 93 int rowBytes, void* image) SK_OVERRIDE; | 113 int rowBytes, void* image) SK_OVERRIDE; |
| 94 virtual bool getPackedGlyphDFBounds(GrGlyph::PackedID, SkIRect* bounds) SK_O VERRIDE; | 114 virtual bool getPackedGlyphDFBounds(GrGlyph::PackedID, SkIRect* bounds) SK_O VERRIDE; |
| 95 virtual bool getPackedGlyphDFImage(GrGlyph::PackedID, int width, int height, | 115 virtual bool getPackedGlyphDFImage(GrGlyph::PackedID, int width, int height, |
| 96 void* image) SK_OVERRIDE; | 116 void* image) SK_OVERRIDE; |
| 97 virtual bool getGlyphPath(uint16_t glyphID, SkPath*); | 117 virtual bool getGlyphPath(uint16_t glyphID, SkPath*); |
| 98 | 118 |
| 99 private: | 119 private: |
| 100 SkGlyphCache* fStrike; | 120 SkGlyphCache* fStrike; |
| 101 GrKey* fKey; | 121 GrKey* fKey; |
| 102 // DECLARE_INSTANCE_COUNTER(SkGrFontScaler); | 122 // DECLARE_INSTANCE_COUNTER(SkGrFontScaler); |
| 103 }; | 123 }; |
| 104 | 124 |
| 105 //////////////////////////////////////////////////////////////////////////////// | 125 //////////////////////////////////////////////////////////////////////////////// |
| 106 | 126 |
| 107 #endif | 127 #endif |
| OLD | NEW |