Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: include/gpu/GrDrawContext.h

Issue 2182603003: Just pass the draw context to paint conversion (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 bool mustUseHWAA(const GrPaint& paint) const { 262 bool mustUseHWAA(const GrPaint& paint) const {
263 return paint.isAntiAlias() && fRenderTarget->isUnifiedMultisampled(); 263 return paint.isAntiAlias() && fRenderTarget->isUnifiedMultisampled();
264 } 264 }
265 265
266 const GrSurfaceDesc& desc() const { return fRenderTarget->desc(); } 266 const GrSurfaceDesc& desc() const { return fRenderTarget->desc(); }
267 int width() const { return fRenderTarget->width(); } 267 int width() const { return fRenderTarget->width(); }
268 int height() const { return fRenderTarget->height(); } 268 int height() const { return fRenderTarget->height(); }
269 GrPixelConfig config() const { return fRenderTarget->config(); } 269 GrPixelConfig config() const { return fRenderTarget->config(); }
270 int numColorSamples() const { return fRenderTarget->numColorSamples(); } 270 int numColorSamples() const { return fRenderTarget->numColorSamples(); }
271 bool isGammaCorrect() const { return fSurfaceProps.isGammaCorrect(); } 271 bool isGammaCorrect() const { return fSurfaceProps.isGammaCorrect(); }
272 SkSourceGammaTreatment sourceGammaTreatment() const {
273 return this->isGammaCorrect() ? SkSourceGammaTreatment::kRespect
274 : SkSourceGammaTreatment::kIgnore;
275 }
272 const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; } 276 const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; }
273 SkColorSpace* getColorSpace() const { return fColorSpace.get(); } 277 SkColorSpace* getColorSpace() const { return fColorSpace.get(); }
274 278
275 bool wasAbandoned() const; 279 bool wasAbandoned() const;
276 280
277 GrRenderTarget* accessRenderTarget() { return fRenderTarget.get(); } 281 GrRenderTarget* accessRenderTarget() { return fRenderTarget.get(); }
278 282
279 sk_sp<GrRenderTarget> renderTarget() { return fRenderTarget; } 283 sk_sp<GrRenderTarget> renderTarget() { return fRenderTarget; }
280 284
281 sk_sp<GrTexture> asTexture() { return sk_ref_sp(fRenderTarget->asTexture()); } 285 sk_sp<GrTexture> asTexture() { return sk_ref_sp(fRenderTarget->asTexture()); }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 366
363 sk_sp<SkColorSpace> fColorSpace; 367 sk_sp<SkColorSpace> fColorSpace;
364 SkSurfaceProps fSurfaceProps; 368 SkSurfaceProps fSurfaceProps;
365 GrAuditTrail* fAuditTrail; 369 GrAuditTrail* fAuditTrail;
366 370
367 // In debug builds we guard against improper thread handling 371 // In debug builds we guard against improper thread handling
368 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) 372 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;)
369 }; 373 };
370 374
371 #endif 375 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698