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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 kGeneral_U
sage, | 61 kGeneral_U
sage, |
62 props.pixe
lGeometry())); | 62 props.pixe
lGeometry())); |
63 return static_cast<SkGpuDevice*>(dev); | 63 return static_cast<SkGpuDevice*>(dev); |
64 } | 64 } |
65 | 65 |
66 GrContext* context() const { return fContext; } | 66 GrContext* context() const { return fContext; } |
67 | 67 |
68 // set all pixels to 0 | 68 // set all pixels to 0 |
69 void clearAll(); | 69 void clearAll(); |
70 | 70 |
71 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE; | 71 GrRenderTarget* accessRenderTarget() SK_OVERRIDE; |
72 | 72 |
73 virtual SkImageInfo imageInfo() const SK_OVERRIDE { | 73 SkImageInfo imageInfo() const SK_OVERRIDE { |
74 return fRenderTarget ? fRenderTarget->surfacePriv().info() : SkImageInfo
::MakeUnknown(); | 74 return fRenderTarget ? fRenderTarget->surfacePriv().info() : SkImageInfo
::MakeUnknown(); |
75 } | 75 } |
76 | 76 |
77 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; | 77 void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; |
78 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, size_t coun
t, | 78 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, size_t coun
t, |
79 const SkPoint[], const SkPaint& paint) SK_OVERRIDE; | 79 const SkPoint[], const SkPaint& paint) SK_OVERRIDE; |
80 virtual void drawRect(const SkDraw&, const SkRect& r, | 80 virtual void drawRect(const SkDraw&, const SkRect& r, |
81 const SkPaint& paint) SK_OVERRIDE; | 81 const SkPaint& paint) SK_OVERRIDE; |
82 virtual void drawRRect(const SkDraw&, const SkRRect& r, | 82 virtual void drawRRect(const SkDraw&, const SkRRect& r, |
83 const SkPaint& paint) SK_OVERRIDE; | 83 const SkPaint& paint) SK_OVERRIDE; |
84 virtual void drawDRRect(const SkDraw& draw, const SkRRect& outer, | 84 virtual void drawDRRect(const SkDraw& draw, const SkRRect& outer, |
85 const SkRRect& inner, const SkPaint& paint) SK_OVERR
IDE; | 85 const SkRRect& inner, const SkPaint& paint) SK_OVERR
IDE; |
86 virtual void drawOval(const SkDraw&, const SkRect& oval, | 86 virtual void drawOval(const SkDraw&, const SkRect& oval, |
87 const SkPaint& paint) SK_OVERRIDE; | 87 const SkPaint& paint) SK_OVERRIDE; |
(...skipping 17 matching lines...) Expand all Loading... |
105 const SkPath& path, const SkMatrix* matrix, | 105 const SkPath& path, const SkMatrix* matrix, |
106 const SkPaint&) SK_OVERRIDE; | 106 const SkPaint&) SK_OVERRIDE; |
107 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, | 107 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCou
nt, |
108 const SkPoint verts[], const SkPoint texs[], | 108 const SkPoint verts[], const SkPoint texs[], |
109 const SkColor colors[], SkXfermode* xmode, | 109 const SkColor colors[], SkXfermode* xmode, |
110 const uint16_t indices[], int indexCount, | 110 const uint16_t indices[], int indexCount, |
111 const SkPaint&) SK_OVERRIDE; | 111 const SkPaint&) SK_OVERRIDE; |
112 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | 112 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, |
113 const SkPaint&) SK_OVERRIDE; | 113 const SkPaint&) SK_OVERRIDE; |
114 | 114 |
115 virtual void flush() SK_OVERRIDE; | 115 void flush() SK_OVERRIDE; |
116 | 116 |
117 virtual void onAttachToCanvas(SkCanvas* canvas) SK_OVERRIDE; | 117 void onAttachToCanvas(SkCanvas* canvas) SK_OVERRIDE; |
118 virtual void onDetachFromCanvas() SK_OVERRIDE; | 118 void onDetachFromCanvas() SK_OVERRIDE; |
119 | 119 |
120 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; | 120 const SkBitmap& onAccessBitmap() SK_OVERRIDE; |
121 | 121 |
122 virtual bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE; | 122 bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE; |
123 virtual bool filterImage(const SkImageFilter*, const SkBitmap&, | 123 virtual bool filterImage(const SkImageFilter*, const SkBitmap&, |
124 const SkImageFilter::Context&, | 124 const SkImageFilter::Context&, |
125 SkBitmap*, SkIPoint*) SK_OVERRIDE; | 125 SkBitmap*, SkIPoint*) SK_OVERRIDE; |
126 | 126 |
127 bool filterTexture(GrContext*, GrTexture*, const SkImageFilter*, | 127 bool filterTexture(GrContext*, GrTexture*, const SkImageFilter*, |
128 const SkImageFilter::Context&, | 128 const SkImageFilter::Context&, |
129 SkBitmap* result, SkIPoint* offset); | 129 SkBitmap* result, SkIPoint* offset); |
130 | 130 |
131 protected: | 131 protected: |
132 virtual bool onReadPixels(const SkImageInfo&, void*, size_t, int, int) SK_OV
ERRIDE; | 132 bool onReadPixels(const SkImageInfo&, void*, size_t, int, int) SK_OVERRIDE; |
133 virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int
) SK_OVERRIDE; | 133 bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int) SK_OVE
RRIDE; |
134 bool onShouldDisableLCD(const SkPaint&) const SK_OVERRIDE; | 134 bool onShouldDisableLCD(const SkPaint&) const SK_OVERRIDE; |
135 | 135 |
136 /** PRIVATE / EXPERIMENTAL -- do not call */ | 136 /** PRIVATE / EXPERIMENTAL -- do not call */ |
137 virtual bool EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* pic
ture, | 137 virtual bool EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* pic
ture, |
138 const SkMatrix*, const SkPaint*) SK_OV
ERRIDE; | 138 const SkMatrix*, const SkPaint*) SK_OV
ERRIDE; |
139 | 139 |
140 private: | 140 private: |
141 GrContext* fContext; | 141 GrContext* fContext; |
142 | 142 |
143 GrSkDrawProcs* fDrawProcs; | 143 GrSkDrawProcs* fDrawProcs; |
144 | 144 |
145 GrClipData fClipData; | 145 GrClipData fClipData; |
146 | 146 |
147 GrTextContext* fTextContext; | 147 GrTextContext* fTextContext; |
148 | 148 |
149 // state for our render-target | 149 // state for our render-target |
150 GrRenderTarget* fRenderTarget; | 150 GrRenderTarget* fRenderTarget; |
151 uint32_t fFlags; | 151 uint32_t fFlags; |
152 | 152 |
153 // remove when our clients don't rely on accessBitmap() | 153 // remove when our clients don't rely on accessBitmap() |
154 SkBitmap fLegacyBitmap; | 154 SkBitmap fLegacyBitmap; |
155 | 155 |
156 SkGpuDevice(GrSurface*, const SkSurfaceProps&, unsigned flags = 0); | 156 SkGpuDevice(GrSurface*, const SkSurfaceProps&, unsigned flags = 0); |
157 | 157 |
158 virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) SK_OVERRID
E; | 158 SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) SK_OVERRIDE; |
159 | 159 |
160 virtual SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_
OVERRIDE; | 160 SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRIDE
; |
161 | 161 |
162 virtual SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE; | 162 SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE; |
163 | 163 |
164 virtual bool forceConservativeRasterClip() const SK_OVERRIDE { return true;
} | 164 bool forceConservativeRasterClip() const SK_OVERRIDE { return true; } |
165 | 165 |
166 // sets the render target and clip on context | 166 // sets the render target and clip on context |
167 void prepareDraw(const SkDraw&); | 167 void prepareDraw(const SkDraw&); |
168 | 168 |
169 /** | 169 /** |
170 * Implementation for both drawBitmap and drawBitmapRect. | 170 * Implementation for both drawBitmap and drawBitmapRect. |
171 */ | 171 */ |
172 void drawBitmapCommon(const SkDraw&, | 172 void drawBitmapCommon(const SkDraw&, |
173 const SkBitmap& bitmap, | 173 const SkBitmap& bitmap, |
174 const SkRect* srcRectPtr, | 174 const SkRect* srcRectPtr, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 bool bicubic); | 208 bool bicubic); |
209 | 209 |
210 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); | 210 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); |
211 | 211 |
212 static SkPicture::AccelData::Key ComputeAccelDataKey(); | 212 static SkPicture::AccelData::Key ComputeAccelDataKey(); |
213 | 213 |
214 typedef SkBaseDevice INHERITED; | 214 typedef SkBaseDevice INHERITED; |
215 }; | 215 }; |
216 | 216 |
217 #endif | 217 #endif |
OLD | NEW |