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

Side by Side Diff: src/gpu/GrPipelineBuilder.h

Issue 1467553002: New API for computing optimization invariants. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 GrPipelineBuilder_DEFINED 8 #ifndef GrPipelineBuilder_DEFINED
9 #define GrPipelineBuilder_DEFINED 9 #define GrPipelineBuilder_DEFINED
10 10
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 */ 356 */
357 void setDrawFace(DrawFace face) { 357 void setDrawFace(DrawFace face) {
358 SkASSERT(kInvalid_DrawFace != face); 358 SkASSERT(kInvalid_DrawFace != face);
359 fDrawFace = face; 359 fDrawFace = face;
360 } 360 }
361 361
362 /// @} 362 /// @}
363 363
364 /////////////////////////////////////////////////////////////////////////// 364 ///////////////////////////////////////////////////////////////////////////
365 365
366 const GrProcOptInfo& colorProcInfo(const GrDrawBatch* batch) const { 366 bool usePLSDstRead(const GrDrawBatch* batch) const;
367 this->calcColorInvariantOutput(batch);
368 return fColorProcInfo;
369 }
370
371 const GrProcOptInfo& coverageProcInfo(const GrDrawBatch* batch) const {
372 this->calcCoverageInvariantOutput(batch);
373 return fCoverageProcInfo;
374 }
375 367
376 void setClip(const GrClip& clip) { fClip = clip; } 368 void setClip(const GrClip& clip) { fClip = clip; }
377 const GrClip& clip() const { return fClip; } 369 const GrClip& clip() const { return fClip; }
378 370
379 private: 371 private:
380 // Calculating invariant color / coverage information is expensive, so we pa rtially cache the 372 // Calculating invariant color / coverage information is expensive, so we pa rtially cache the
381 // results. 373 // results.
382 // 374 //
383 // canUseFracCoveragePrimProc() - Called in regular skia draw, caches result s but only for a 375 // canUseFracCoveragePrimProc() - Called in regular skia draw, caches result s but only for a
384 // specific color and coverage. May be calle d multiple times 376 // specific color and coverage. May be calle d multiple times
385 // GrOptDrawState constructor - never caches results 377 // GrOptDrawState constructor - never caches results
386 378
387 /** 379 /**
388 * GrBatch provides the initial seed for these loops based off of its initia l geometry data 380 * GrBatch provides the initial seed for these loops based off of its initia l geometry data
389 */ 381 */
390 void calcColorInvariantOutput(const GrDrawBatch*) const; 382 void computeBatchToXPOverrides(GrInitInvariantOutput* color, GrInitInvariant Output* coverage,
391 void calcCoverageInvariantOutput(const GrDrawBatch*) const; 383 bool* usePLSDstRead) const;
joshualitt 2015/11/23 19:09:29 Remove
392 384
393 // Some of the auto restore objects assume that no effects are removed durin g their lifetime. 385 // Some of the auto restore objects assume that no effects are removed durin g their lifetime.
394 // This is used to assert that this condition holds. 386 // This is used to assert that this condition holds.
395 SkDEBUGCODE(mutable int fBlockEffectRemovalCnt;) 387 SkDEBUGCODE(mutable int fBlockEffectRemovalCnt;)
396 388
397 typedef SkSTArray<4, const GrFragmentProcessor*, true> FragmentProcessorArra y; 389 typedef SkSTArray<4, const GrFragmentProcessor*, true> FragmentProcessorArra y;
398 390
399 SkAutoTUnref<GrRenderTarget> fRenderTarget; 391 SkAutoTUnref<GrRenderTarget> fRenderTarget;
400 uint32_t fFlags; 392 uint32_t fFlags;
401 GrStencilSettings fStencilSettings; 393 GrStencilSettings fStencilSettings;
402 DrawFace fDrawFace; 394 DrawFace fDrawFace;
403 mutable SkAutoTUnref<const GrXPFactory> fXPFactory; 395 mutable SkAutoTUnref<const GrXPFactory> fXPFactory;
404 FragmentProcessorArray fColorFragmentProcessors; 396 FragmentProcessorArray fColorFragmentProcessors;
405 FragmentProcessorArray fCoverageFragmentProcessors; 397 FragmentProcessorArray fCoverageFragmentProcessors;
406 GrClip fClip; 398 GrClip fClip;
407 399
408 mutable GrProcOptInfo fColorProcInfo;
409 mutable GrProcOptInfo fCoverageProcInfo;
410
411 friend class GrPipeline; 400 friend class GrPipeline;
401 friend class GrDrawTarget;
412 }; 402 };
413 403
414 #endif 404 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698