aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrAtlasTextOp.cpp
Commit message (Collapse)AuthorAge
...
* Some more clipped text optimizations.Gravatar Jim Van Verth2017-10-25
| | | | | | | | | | | | * Limit size of text batches to keep inside default vertex buffer size * Expand geodata allocation by 1.5x rather than 2x * Don't add text subruns that lie outside the clip rect Bug: skia:3990 Change-Id: I2b8f8bc5599d14c43e0a98e9633bc51980a7619c Reviewed-on: https://skia-review.googlesource.com/62861 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Use uint16_t instead of SkIPoint16 when clipping texCoords for text.Gravatar Jim Van Verth2017-10-20
| | | | | | | | | | | | | The texCoords and texture indices are packed into two uint16_t, so that should be used instead of SkIPoint16 for clipping. This CL also cleans up the clipping code a little, and keeps everything in int arithmetic (since the positions and coords are pixel/texel aligned). Bug: skia:6990 Change-Id: I9a237f7df32467adb6a56ddeca6352cbd4f8dd6f Reviewed-on: https://skia-review.googlesource.com/62360 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Fix ASAN issue with clipped text.Gravatar Jim Van Verth2017-10-20
| | | | | | | Change-Id: I340dfc77afc26cd4c97ca7ec1419e7716e632dca Reviewed-on: https://skia-review.googlesource.com/62280 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Clip text geometrically when possible.Gravatar Jim Van Verth2017-10-20
| | | | | | | | | | | | Currently when we clip text we can't batch the clipped text with non-clipped text. By modifying the quads and texCoords we can produce the same effect, and allow batching. Includes some minor text code cleanup. Bug: skia:6990 Change-Id: Ibfd4bc2fdc2d7680071e2abddd4d77fc3017e3d3 Reviewed-on: https://skia-review.googlesource.com/60780 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Make GrResourceProvider more sk_spifiedGravatar Brian Salomon2017-10-16
| | | | | | | Change-Id: If191553093031705756358f4551a5b1e96439742 Reviewed-on: https://skia-review.googlesource.com/60000 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Use shader based blending to clamp kPlus mode w/F16Gravatar Brian Osman2017-09-20
| | | | | | | | Bug: skia:6173 Change-Id: I21042d484d9a7b3eee04aa3301d9793d00ad6908 Reviewed-on: https://skia-review.googlesource.com/48183 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Revert "Allow GrDrawOpAtlas to grow as needed""Gravatar Jim Van Verth2017-09-18
| | | | | | | | Bug: skia:3550 Change-Id: I11a3b39ed7470542447f0e46141a26eef7a9bdaf Reviewed-on: https://skia-review.googlesource.com/47240 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Revert "Allow GrDrawOpAtlas to grow as needed"Gravatar Jim Van Verth2017-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 03168b8a62a0d3d14b7a0d14642df4d82203b87c. Reason for revert: Assert in resetting texture proxies. Original change's description: > Allow GrDrawOpAtlas to grow as needed > > Bug: skia:3550 > Change-Id: Ib5312c8c06ba8549d90545658df6686c45058255 > Reviewed-on: https://skia-review.googlesource.com/45841 > Commit-Queue: Jim Van Verth <jvanverth@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> TBR=jvanverth@google.com,robertphillips@google.com Change-Id: I05e084b4cefa57e558f296d6087d4f03fa16ac81 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:3550 Reviewed-on: https://skia-review.googlesource.com/47140 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Allow GrDrawOpAtlas to grow as neededGravatar Jim Van Verth2017-09-15
| | | | | | | | Bug: skia:3550 Change-Id: Ib5312c8c06ba8549d90545658df6686c45058255 Reviewed-on: https://skia-review.googlesource.com/45841 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Add support for additional textures in GrDrawOpAtlasGravatar Jim Van Verth2017-09-12
| | | | | | | | | | Step two in supporting growable/shrinkable atlases. Bug: skia:3550 Change-Id: I0cdec2a9f59cc8ced071bfeec2f8ed5a228c4b7a Reviewed-on: https://skia-review.googlesource.com/43260 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Rework GrSamplerParams to be more compact and use its own wrap mode enum.Gravatar Brian Salomon2017-09-07
| | | | | | | | | The main change is to make GrSamplerParams smaller by making its enums have byte-sized underlying types. The rest is cosmetic. Change-Id: Ib71ea50612d24619a85e463826c6b8dfb9b445e3 Reviewed-on: https://skia-review.googlesource.com/43200 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Move GrAppliedClip into GrPipelineGravatar Brian Salomon2017-08-10
| | | | | | | Change-Id: I522c2fd52bea9813baba7cdb3f11b63e7ab96b50 Reviewed-on: https://skia-review.googlesource.com/28861 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Move GrProcessorSet into GrPipelineGravatar Brian Salomon2017-08-09
| | | | | | | Change-Id: Ibfa5e1adda3c32140590aa62a31d35654cef79dd Reviewed-on: https://skia-review.googlesource.com/28187 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Remove GrLegacyMeshDrawOp and GrPipelineBuilderGravatar Brian Salomon2017-07-19
| | | | | | | Change-Id: Ib301a0e7d4b4c4f05417d28862017307949748c9 Reviewed-on: https://skia-review.googlesource.com/23584 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Revert "Revert "Make GrAtlasTextOp a non-legacy GrMeshDrawOp""Gravatar Brian Salomon2017-07-19
| | | | | | | | | | | | | This reverts commit e3e9628ecf863f433f26bf6107d6a39ced57fe30. Adds blendmode_mask_* benchs to blacklist for Chromecast. Otherwise a clean revert of the revert. Bug: skia: Change-Id: I9f64ae55804fa4aad97c1785834281039570c56c Reviewed-on: https://skia-review.googlesource.com/24409 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Revert "Make GrAtlasTextOp a non-legacy GrMeshDrawOp"Gravatar Brian Salomon2017-07-17
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 434a58ab5fefcc1b86588c7fce898b1e5bd248ba. Reason for revert: <INSERT REASONING HERE> Original change's description: > Make GrAtlasTextOp a non-legacy GrMeshDrawOp > > Change-Id: Ib9eaf149100b0ccecf1c18a755263f2579b8e6f6 > Reviewed-on: https://skia-review.googlesource.com/23482 > Reviewed-by: Jim Van Verth <jvanverth@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> TBR=jvanverth@google.com,bsalomon@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: I7fd8503b4e0c297b2cfaf979545354aa58d1f989 Reviewed-on: https://skia-review.googlesource.com/23760 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Make GrAtlasTextOp a non-legacy GrMeshDrawOpGravatar Brian Salomon2017-07-14
| | | | | | | Change-Id: Ib9eaf149100b0ccecf1c18a755263f2579b8e6f6 Reviewed-on: https://skia-review.googlesource.com/23482 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Add proper aliased support for SDF textGravatar Jim Van Verth2017-07-06
| | | | | | | | | | | | | Previously, when asked to render aliased text with distance fields, we would get the aliased glyph from the cache and then try to anti-alias the edge. This change instead grabs the anti-aliased glyph, then deliberately aliases the edge. Bug: chromium:707979 Change-Id: I05766af17d7ae58bca27aaffd9e08e5c586e789c Reviewed-on: https://skia-review.googlesource.com/21728 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Clean up GrResourceProvider usageGravatar Robert Phillips2017-06-15
| | | | | | | | | | | | | The only substantive changes are the removal of GrProxy instantiation in: SkGpuBlurUtils::GaussianBlur GrSimpleTextureEffect::Make* Change-Id: I10970609693bd6ff5b3a3c21b41d82642bb277bc Reviewed-on: https://skia-review.googlesource.com/19965 Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Add GrPrimitiveType::kLinesAdjacencyGravatar Chris Dalton2017-06-13
| | | | | | | | | | Converts GrPrimitiveType to an enum class and adds kLinesAdjacency. Bug: skia: Change-Id: I3b5e68acfb20476f6c6923968f5a4ac4f73ae12d Reviewed-on: https://skia-review.googlesource.com/19680 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Revert "Add GrPrimitiveType::kLinesAdjacency"Gravatar Ravi Mistry2017-06-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f7eb015083aba8942031145736251dd32094115d. Reason for revert: Looks like this is causing build failures: * https://chromium-swarm.appspot.com/task?id=36baaf4d376bbf10&refresh=10 * https://chromium-swarm.appspot.com/task?id=36baad1f17e93510&refresh=10 Original change's description: > Add GrPrimitiveType::kLinesAdjacency > > Converts GrPrimitiveType to an enum class and adds kLinesAdjacency. > > Bug: skia: > Change-Id: If57d26277182aac1375e8181211ddaf7ea6d1e0a > Reviewed-on: https://skia-review.googlesource.com/19581 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Chris Dalton <csmartdalton@google.com> TBR=bsalomon@google.com,csmartdalton@google.com Change-Id: I37a1c575123b357abd8b9af9eea8871fe199f44b No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/19661 Reviewed-by: Ravi Mistry <rmistry@google.com> Commit-Queue: Ravi Mistry <rmistry@google.com>
* Add GrPrimitiveType::kLinesAdjacencyGravatar Chris Dalton2017-06-13
| | | | | | | | | | Converts GrPrimitiveType to an enum class and adds kLinesAdjacency. Bug: skia: Change-Id: If57d26277182aac1375e8181211ddaf7ea6d1e0a Reviewed-on: https://skia-review.googlesource.com/19581 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Fix LCD distance field text color filteringGravatar Jim Van Verth2017-06-08
| | | | | | | | | | | Distance field text was applying the color filter to determine any gamma adjustments, but not any effects of the shader as well. Bug: skia:6669 Change-Id: I73384f68141fb523ea2058e00d0a9fbb2fbc622b Reviewed-on: https://skia-review.googlesource.com/19049 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Fix glDrawRangeElementsGravatar Chris Dalton2017-05-30
| | | | | | | | | | | | | | | | | | Adds explicit min/max index value fields to GrMesh. This eliminates the previous assumption that the index values were within the range [0..vertexCount-1]. In the pattern case we still maintain this assumption. Updates GrMesh to hide its fields and handle its new complexity using a "helper" interface instead. Adds a unit test for GrMesh. Bug: skia: Change-Id: Ia23de72d510f8827cee56072b727fb70a6e46b8d Reviewed-on: https://skia-review.googlesource.com/17964 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Convert GrMesh back to a classGravatar Chris Dalton2017-05-15
| | | | | | | | | | | Specific methods that limit the data to valid configurations are better than a runtime mega-assert. Bug: skia: Change-Id: Ie15f2dc79659e44cfaddd16eb474795b110fda73 Reviewed-on: https://skia-review.googlesource.com/16577 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Fix GPU text colors when color spaces are involvedGravatar Brian Osman2017-05-11
| | | | | | | | | | | | | 1) Only store GrColors in GrTextUtils::Paint. We still store premul and unpremul versions, but this is slightly clearer. 2) GrTextUtils::Paint also needs info from the render target context to linearize and transform the color to dst space. Bug: skia:6605 Change-Id: I6e12c55eafaecd2a090c82b4f56827401305bf3a Reviewed-on: https://skia-review.googlesource.com/16486 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Convert GrMesh to a structGravatar Chris Dalton2017-05-03
| | | | | | | | | | | | | Converts GrMesh to a struct and changes the names/semantics of its fields to be more inline with their GL counterparts. Also renames the "instancing" feature to "pattern", to avoid ambiguity with hardware instancing. Bug: skia: Change-Id: Ia0999d4f9c83b5dd31f81b9bf4f36ed9abd26286 Reviewed-on: https://skia-review.googlesource.com/15157 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Move pipeline handling out of GrMeshDrawOp.Gravatar Brian Salomon2017-04-03
| | | | | | | | | | | The monolithic GrPipeline is moved to a subclass GrLegacyDrawMeshOp. The pipeline used to record a GrMesh draw in a GrMeshDrawOp must now be passed rather than implicitly using the op's pipeline. Change-Id: I50d77e4dcc8d91a523fa7566ce43a9a291174706 Reviewed-on: https://skia-review.googlesource.com/11002 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Renames of processor analysis-related classes and method.Gravatar Brian Salomon2017-03-30
| | | | | | | | | | | | GrProcesserSet::FragmentProcessorAnalysis->GrProcessorSet::Analysis GrPipelineAnalysisColor->GrProcessorAnalysisColor GrPipelineAnalysisCoverage->GrProcessorAnalysisCoverage GrMeshDrawOp::getFragmentProcessorAnalysisInputs->GrMeshDrawOp::getProcessorAnalysisInputs Change-Id: I28ad19dfab5f4ac1788c4eacdec5e1af2a701dd0 Reviewed-on: https://skia-review.googlesource.com/10747 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Remove GrPipelineOptimizations computation from GrPipeline::init and nest in ↵Gravatar Brian Salomon2017-03-29
| | | | | | | | | GrMeshDrawOp. Change-Id: I4a702c83857606c1cb050294c408922eef5769ea Reviewed-on: https://skia-review.googlesource.com/10414 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Split GrPipelineInput into separate color and coverage types, the latter of ↵Gravatar Brian Salomon2017-03-27
| | | | | | | | | | | | | | | which is just an enum. Assign names that indicate that they aren't just for the input phase since I plan to use them at the boundary between FPs and XPs as well. Renamed GrProcOptInfo to GrColorFragmentProcessorAnalysis. This is now only used on the color side and the new name seems clearer to me. Change GrMeshDrawOp::getFragmentProcessorAnalysisInputs to use the new color/coverage types directly rather than a class that has been reduced to simply bundling them together. Change-Id: If93bae74c9d590486eecdf63f302418c96deab65 Reviewed-on: https://skia-review.googlesource.com/10161 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Retract GrContext from src/gpu/effectsGravatar Robert Phillips2017-03-15
| | | | | | | Change-Id: Iceb7263098286bafb2605ef17d1fe6bb25d71e97 Reviewed-on: https://skia-review.googlesource.com/9693 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Store clipped bounds on GrOp rather than in parallel in GrRenderTargetOpList.Gravatar Brian Salomon2017-03-06
| | | | | | | | | When the op is recorded we update its bounds to incorporate both clipping and aa bloat. Change-Id: Ia205e058ebeda5fcdb2cd5e9b8a30a4972672b14 Reviewed-on: https://skia-review.googlesource.com/9233 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Clean up/remove unused GrFragmentProcessor-derived ctorsGravatar Robert Phillips2017-02-28
| | | | | | | | | This is the simple (i.e., non-TextureAdjuster) portion of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors) Change-Id: I8f673ebe922e03c69473c18c166bcf818507c662 Reviewed-on: https://skia-review.googlesource.com/8997 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Make GrPipelineAnalysis a nested class of GrProcessorSet.Gravatar Brian Salomon2017-02-22
| | | | | | | | | | | | | | | | It is renamed to FragmentProcessorAnalysis since it represents the outputs of the final FPs. It now stores the analysis results that are subsequently needed rather than exposing GrProcOptInfo. GrProcOptInfo is now only used on color FPs (not coverage). Miscellaneous related renamings. Change-Id: I95c518a7a76df6dc294a9fa67c611f8f653247bc Reviewed-on: https://skia-review.googlesource.com/8534 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Remove component flags from GrPipelineInput.Gravatar Brian Salomon2017-02-14
| | | | | | | | | We don't use these anywhere downstream except to check for opaqueness. Change-Id: I897137135d69004ed45c0f4c1e7297183f49fc6d Reviewed-on: https://skia-review.googlesource.com/8402 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Removes tracking of whether color is ignored by XP.Gravatar Brian Salomon2017-01-04
| | | | | | | | | Removes the feedback to GrDrawOp via GrPipelineOptimizations. Change-Id: I3cb17cad41779af292a92385fcd5ac23ae5a1ffd Reviewed-on: https://skia-review.googlesource.com/6561 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Removing tracking of whether GP/FP coverage calculations are used by XP.Gravatar Brian Salomon2017-01-04
| | | | | | | | | | | | | | | Remove readsCoverage from GrPipelineOptimizations Remove kNone from GrDefaultGeoProc::Coverage Remove kIgnoreCoverage from GrXferProcessor::OptFlags Remove GrPipeline::fIgnoresCoverage Change-Id: I8f0c9337ee98b9c77af1e9a8a184519ce63822d4 Reviewed-on: https://skia-review.googlesource.com/6552 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Misc batch->op cleanup Part 1 of 2Gravatar Brian Salomon2016-12-21
| | | | | | | Change-Id: I80f951976558a284e55386e0a368f08bd835d8ca Reviewed-on: https://skia-review.googlesource.com/6359 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* This renames methods and classes that relate to static analysis of ↵Gravatar Brian Salomon2016-12-21
| | | | | | | | | combinations of GrDrawOps and GrPipelines. Change-Id: I737b901a19d3c67d2ff7f95802fb4df35656beb2 Reviewed-on: https://skia-review.googlesource.com/6199 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Rename GrBatchFontCache->GrAtlasGlyphCacheGravatar Brian Salomon2016-12-16
| | | | | | | Change-Id: Ie21e18b631daa24e70df630b9f910213f62bdbdf Reviewed-on: https://skia-review.googlesource.com/6164 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* move src/gpu/batches -> src/gpu/opsGravatar Brian Salomon2016-12-16
Change-Id: I6410eae41f051ce38bef6f38d670924c3483c325 Reviewed-on: https://skia-review.googlesource.com/6163 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>