OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrDrawContext_DEFINED | 8 #ifndef GrDrawContext_DEFINED |
9 #define GrDrawContext_DEFINED | 9 #define GrDrawContext_DEFINED |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 struct SkIPoint; | 37 struct SkIPoint; |
38 struct SkIRect; | 38 struct SkIRect; |
39 class SkMatrix; | 39 class SkMatrix; |
40 class SkPaint; | 40 class SkPaint; |
41 class SkPath; | 41 class SkPath; |
42 struct SkPoint; | 42 struct SkPoint; |
43 struct SkRect; | 43 struct SkRect; |
44 class SkRRect; | 44 class SkRRect; |
45 struct SkRSXform; | 45 struct SkRSXform; |
46 class SkTextBlob; | 46 class SkTextBlob; |
47 struct GrUserStencilSettings; | |
48 | 47 |
49 /* | 48 /* |
50 * A helper object to orchestrate draws | 49 * A helper object to orchestrate draws |
51 */ | 50 */ |
52 class SK_API GrDrawContext : public SkRefCnt { | 51 class SK_API GrDrawContext : public SkRefCnt { |
53 public: | 52 public: |
54 ~GrDrawContext() override; | 53 ~GrDrawContext() override; |
55 | 54 |
56 bool copySurface(GrSurface* src, const SkIRect& srcRect, const SkIPoint& dst
Point); | 55 bool copySurface(GrSurface* src, const SkIRect& srcRect, const SkIPoint& dst
Point); |
57 | 56 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 const SkIRect& center, | 253 const SkIRect& center, |
255 const SkRect& dst); | 254 const SkRect& dst); |
256 | 255 |
257 bool isStencilBufferMultisampled() const { | 256 bool isStencilBufferMultisampled() const { |
258 return fRenderTarget->isStencilBufferMultisampled(); | 257 return fRenderTarget->isStencilBufferMultisampled(); |
259 } | 258 } |
260 bool isUnifiedMultisampled() const { return fRenderTarget->isUnifiedMultisam
pled(); } | 259 bool isUnifiedMultisampled() const { return fRenderTarget->isUnifiedMultisam
pled(); } |
261 bool hasMixedSamples() const { return fRenderTarget->hasMixedSamples(); } | 260 bool hasMixedSamples() const { return fRenderTarget->hasMixedSamples(); } |
262 | 261 |
263 bool mustUseHWAA(const GrPaint& paint) const { | 262 bool mustUseHWAA(const GrPaint& paint) const { |
264 return paint.isAntiAlias() && | 263 return paint.isAntiAlias() && fRenderTarget->isUnifiedMultisampled(); |
265 (fRenderTarget->isUnifiedMultisampled() || fRenderTarget->hasMixe
dSamples()); | |
266 } | 264 } |
267 | 265 |
268 const GrSurfaceDesc& desc() const { return fRenderTarget->desc(); } | 266 const GrSurfaceDesc& desc() const { return fRenderTarget->desc(); } |
269 int width() const { return fRenderTarget->width(); } | 267 int width() const { return fRenderTarget->width(); } |
270 int height() const { return fRenderTarget->height(); } | 268 int height() const { return fRenderTarget->height(); } |
271 GrPixelConfig config() const { return fRenderTarget->config(); } | 269 GrPixelConfig config() const { return fRenderTarget->config(); } |
272 int numColorSamples() const { return fRenderTarget->numColorSamples(); } | 270 int numColorSamples() const { return fRenderTarget->numColorSamples(); } |
273 bool isGammaCorrect() const { return fSurfaceProps.isGammaCorrect(); } | 271 bool isGammaCorrect() const { return fSurfaceProps.isGammaCorrect(); } |
274 const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; } | 272 const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; } |
275 | 273 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 const GrUserStencilSettings* ss); | 338 const GrUserStencilSettings* ss); |
341 | 339 |
342 void internalDrawPath(const GrClip& clip, | 340 void internalDrawPath(const GrClip& clip, |
343 const GrPaint& paint, | 341 const GrPaint& paint, |
344 const SkMatrix& viewMatrix, | 342 const SkMatrix& viewMatrix, |
345 const SkPath& path, | 343 const SkPath& path, |
346 const GrStyle& style); | 344 const GrStyle& style); |
347 | 345 |
348 // This entry point allows the GrTextContext-derived classes to add their ba
tches to | 346 // This entry point allows the GrTextContext-derived classes to add their ba
tches to |
349 // the drawTarget. | 347 // the drawTarget. |
350 void drawBatch(const GrPaint&, const GrClip&, const GrUserStencilSettings&,
GrDrawBatch* batch, | 348 void drawBatch(const GrPipelineBuilder& pipelineBuilder, const GrClip&, GrDr
awBatch* batch); |
351 GrDrawFace = GrDrawFace::kBoth); | |
352 | 349 |
353 GrDrawTarget* getDrawTarget(); | 350 GrDrawTarget* getDrawTarget(); |
354 | 351 |
355 GrDrawingManager* fDrawingManager; | 352 GrDrawingManager* fDrawingManager; |
356 sk_sp<GrRenderTarget> fRenderTarget; | 353 sk_sp<GrRenderTarget> fRenderTarget; |
357 | 354 |
358 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked | 355 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked |
359 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. | 356 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. |
360 GrDrawTarget* fDrawTarget; | 357 GrDrawTarget* fDrawTarget; |
361 SkAutoTDelete<GrAtlasTextContext> fAtlasTextContext; | 358 SkAutoTDelete<GrAtlasTextContext> fAtlasTextContext; |
362 GrContext* fContext; | 359 GrContext* fContext; |
363 GrInstancedPipelineInfo fInstancedPipelineInfo; | 360 GrInstancedPipelineInfo fInstancedPipelineInfo; |
364 | 361 |
365 SkSurfaceProps fSurfaceProps; | 362 SkSurfaceProps fSurfaceProps; |
366 GrAuditTrail* fAuditTrail; | 363 GrAuditTrail* fAuditTrail; |
367 | 364 |
368 // In debug builds we guard against improper thread handling | 365 // In debug builds we guard against improper thread handling |
369 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) | 366 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
370 }; | 367 }; |
371 | 368 |
372 #endif | 369 #endif |
OLD | NEW |