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

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
« no previous file with comments | « src/gpu/GrPipeline.cpp ('k') | src/gpu/GrPipelineBuilder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 */ 353 */
354 void setDrawFace(DrawFace face) { 354 void setDrawFace(DrawFace face) {
355 SkASSERT(kInvalid_DrawFace != face); 355 SkASSERT(kInvalid_DrawFace != face);
356 fDrawFace = face; 356 fDrawFace = face;
357 } 357 }
358 358
359 /// @} 359 /// @}
360 360
361 /////////////////////////////////////////////////////////////////////////// 361 ///////////////////////////////////////////////////////////////////////////
362 362
363 const GrProcOptInfo& colorProcInfo(const GrDrawBatch* batch) const { 363 bool usePLSDstRead(const GrDrawBatch* batch) const;
364 this->calcColorInvariantOutput(batch);
365 return fColorProcInfo;
366 }
367
368 const GrProcOptInfo& coverageProcInfo(const GrDrawBatch* batch) const {
369 this->calcCoverageInvariantOutput(batch);
370 return fCoverageProcInfo;
371 }
372 364
373 void setClip(const GrClip& clip) { fClip = clip; } 365 void setClip(const GrClip& clip) { fClip = clip; }
374 const GrClip& clip() const { return fClip; } 366 const GrClip& clip() const { return fClip; }
375 367
376 private: 368 private:
377 // Calculating invariant color / coverage information is expensive, so we pa rtially cache the
378 // results.
379 //
380 // canUseFracCoveragePrimProc() - Called in regular skia draw, caches result s but only for a
381 // specific color and coverage. May be calle d multiple times
382 // GrOptDrawState constructor - never caches results
383
384 /**
385 * GrBatch provides the initial seed for these loops based off of its initia l geometry data
386 */
387 void calcColorInvariantOutput(const GrDrawBatch*) const;
388 void calcCoverageInvariantOutput(const GrDrawBatch*) const;
389
390 // Some of the auto restore objects assume that no effects are removed durin g their lifetime. 369 // Some of the auto restore objects assume that no effects are removed durin g their lifetime.
391 // This is used to assert that this condition holds. 370 // This is used to assert that this condition holds.
392 SkDEBUGCODE(mutable int fBlockEffectRemovalCnt;) 371 SkDEBUGCODE(mutable int fBlockEffectRemovalCnt;)
393 372
394 typedef SkSTArray<4, const GrFragmentProcessor*, true> FragmentProcessorArra y; 373 typedef SkSTArray<4, const GrFragmentProcessor*, true> FragmentProcessorArra y;
395 374
396 SkAutoTUnref<GrRenderTarget> fRenderTarget; 375 SkAutoTUnref<GrRenderTarget> fRenderTarget;
397 uint32_t fFlags; 376 uint32_t fFlags;
398 GrStencilSettings fStencilSettings; 377 GrStencilSettings fStencilSettings;
399 DrawFace fDrawFace; 378 DrawFace fDrawFace;
400 mutable SkAutoTUnref<const GrXPFactory> fXPFactory; 379 mutable SkAutoTUnref<const GrXPFactory> fXPFactory;
401 FragmentProcessorArray fColorFragmentProcessors; 380 FragmentProcessorArray fColorFragmentProcessors;
402 FragmentProcessorArray fCoverageFragmentProcessors; 381 FragmentProcessorArray fCoverageFragmentProcessors;
403 GrClip fClip; 382 GrClip fClip;
404 383
405 mutable GrProcOptInfo fColorProcInfo;
406 mutable GrProcOptInfo fCoverageProcInfo;
407
408 friend class GrPipeline; 384 friend class GrPipeline;
385 friend class GrDrawTarget;
409 }; 386 };
410 387
411 #endif 388 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrPipeline.cpp ('k') | src/gpu/GrPipelineBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698