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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) SK_OVERRID
E; |
159 | 159 |
160 virtual SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_
OVERRIDE; | 160 virtual SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_
OVERRIDE; |
161 | 161 |
162 virtual SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE; | 162 virtual SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE; |
163 | 163 |
164 virtual bool forceConservativeRasterClip() const SK_OVERRIDE { return true;
} | 164 virtual bool forceConservativeRasterClip() const SK_OVERRIDE { return true;
} |
165 | 165 |
166 // sets the render target, clip, and matrix on GrContext. Use forceIdenity t
o override | 166 // sets the render target and clip on context |
167 // SkDraw's matrix and draw in device coords. | 167 void prepareDraw(const SkDraw&); |
168 void prepareDraw(const SkDraw&, bool forceIdentity); | |
169 | 168 |
170 /** | 169 /** |
171 * Implementation for both drawBitmap and drawBitmapRect. | 170 * Implementation for both drawBitmap and drawBitmapRect. |
172 */ | 171 */ |
173 void drawBitmapCommon(const SkDraw&, | 172 void drawBitmapCommon(const SkDraw&, |
174 const SkBitmap& bitmap, | 173 const SkBitmap& bitmap, |
175 const SkRect* srcRectPtr, | 174 const SkRect* srcRectPtr, |
176 const SkSize* dstSizePtr, // ignored iff srcRectP
tr == NULL | 175 const SkSize* dstSizePtr, // ignored iff srcRectP
tr == NULL |
177 const SkPaint&, | 176 const SkPaint&, |
178 SkCanvas::DrawBitmapRectFlags flags); | 177 SkCanvas::DrawBitmapRectFlags flags); |
179 | 178 |
180 /** | 179 /** |
181 * Helper functions called by drawBitmapCommon. By the time these are called
the SkDraw's | 180 * Helper functions called by drawBitmapCommon. By the time these are called
the SkDraw's |
182 * matrix, clip, and the device's render target has already been set on GrCo
ntext. | 181 * matrix, clip, and the device's render target has already been set on GrCo
ntext. |
183 */ | 182 */ |
184 | 183 |
185 // The tileSize and clippedSrcRect will be valid only if true is returned. | 184 // The tileSize and clippedSrcRect will be valid only if true is returned. |
186 bool shouldTileBitmap(const SkBitmap& bitmap, | 185 bool shouldTileBitmap(const SkBitmap& bitmap, |
| 186 const SkMatrix& viewMatrix, |
187 const GrTextureParams& sampler, | 187 const GrTextureParams& sampler, |
188 const SkRect* srcRectPtr, | 188 const SkRect* srcRectPtr, |
189 int maxTileSize, | 189 int maxTileSize, |
190 int* tileSize, | 190 int* tileSize, |
191 SkIRect* clippedSrcRect) const; | 191 SkIRect* clippedSrcRect) const; |
192 void internalDrawBitmap(const SkBitmap&, | 192 void internalDrawBitmap(const SkBitmap&, |
| 193 const SkMatrix& viewMatrix, |
193 const SkRect&, | 194 const SkRect&, |
194 const GrTextureParams& params, | 195 const GrTextureParams& params, |
195 const SkPaint& paint, | 196 const SkPaint& paint, |
196 SkCanvas::DrawBitmapRectFlags flags, | 197 SkCanvas::DrawBitmapRectFlags flags, |
197 bool bicubic, | 198 bool bicubic, |
198 bool needsTextureDomain); | 199 bool needsTextureDomain); |
199 void drawTiledBitmap(const SkBitmap& bitmap, | 200 void drawTiledBitmap(const SkBitmap& bitmap, |
| 201 const SkMatrix& viewMatrix, |
200 const SkRect& srcRect, | 202 const SkRect& srcRect, |
201 const SkIRect& clippedSrcRect, | 203 const SkIRect& clippedSrcRect, |
202 const GrTextureParams& params, | 204 const GrTextureParams& params, |
203 const SkPaint& paint, | 205 const SkPaint& paint, |
204 SkCanvas::DrawBitmapRectFlags flags, | 206 SkCanvas::DrawBitmapRectFlags flags, |
205 int tileSize, | 207 int tileSize, |
206 bool bicubic); | 208 bool bicubic); |
207 | 209 |
208 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); | 210 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); |
209 | 211 |
210 static SkPicture::AccelData::Key ComputeAccelDataKey(); | 212 static SkPicture::AccelData::Key ComputeAccelDataKey(); |
211 | 213 |
212 typedef SkBaseDevice INHERITED; | 214 typedef SkBaseDevice INHERITED; |
213 }; | 215 }; |
214 | 216 |
215 #endif | 217 #endif |
OLD | NEW |