aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPathRange.cpp
Commit message (Collapse)AuthorAge
* Refactor to separate backend object lifecycle and GpuResource budget decisionGravatar kkinnunen2016-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor GrGpuResource to contain two different pieces of state: a) instance is budgeted or not budgeted b) instance references wrapped backend objects or not The "object lifecycle" was also attached to backend object handles (ids), which made the code a bit unclear. Backend objects would be associated with GrGpuResource::LifeCycle, even though GrGpuResource::LifeCycle refers to the GpuResource, and individual backend objects in one GpuResource might be governed with different "lifecycle". Mark the budgeted/not budgeted with SkBudgeted::kYes, SkBudgeted::kNo. This was previously GrGpuResource::kCached_LifeCycle, GrGpuResource::kUncached_LifeCycle. Mark the "references wrapped object" with boolean. This was previously GrGpuResource::kBorrowed_LifeCycle, GrGpuResource::kAdopted_LifeCycle for GrGpuResource. Associate the backend object ownership status with GrBackendObjectOwnership for the backend object handles. The resource type leaf constuctors, such has GrGLTexture or GrGLTextureRenderTarget take "budgeted" parameter. This parameter is passed to GrGpuResource::registerWithCache(). The resource type intermediary constructors, such as GrGLTexture constructors for class GrGLTextureRenderTarget do not take "budgeted" parameters, intermediary construtors do not call registerWithCache. Removes the need for tagging GrGpuResource -derived subclass constructors with "Derived" parameter. Makes instances that wrap backend objects be registered with a new function GrGpuResource::registerWithCacheWrapped(). Removes "budgeted" parameter from classes such as StencilAttahment, as they are always cached and never wrap any external backend objects. Removes the use of concept "external" from the member function names. The API refers to the objects as "wrapped", so make all related functions use the term consistently. No change in functionality. Resources referencing wrapped objects are always inserted to the cache with budget decision kNo. BUG=594928 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1862043002 Review URL: https://codereview.chromium.org/1862043002
* Updates nvpr text blobs to not store a direct reference to theGravatar cdalton2015-10-08
| | | | | | | | | | | per-glyph GPU path object, but rather store a key for looking it up in the resource cache. This allows the cache to purge glyphs when needed. Also indirectly fixes a memory leak that was introduced with nvpr text blobs. BUG=skia: Review URL: https://codereview.chromium.org/1374853004
* Make path range loading explicitGravatar cdalton2015-10-05
| | | | | | | | | | Requires the caller to explicitly preload paths within a range before calling drawPaths. This allows us to remove the implicit lazy load, thereby eliminating a redundant check on every redraw of a text blob. BUG=skia: Review URL: https://codereview.chromium.org/1382013002
* Improve caching of dashed paths in GrStencilAndCoverPathRendererGravatar kkinnunen2015-05-18
| | | | | | | | | | | | | | | | Improve caching of dashed paths in GrStencilAndCoverPathRenderer. Look up the (NVPR specific) GrGLPath based on GrStrokeInfo and the original path. Use unique keys for all GrPaths. Dash the path with Skia dash stroker and use that path geometry for NVPR path. NVPR internal dashing stroke is not used, because the dashing implementation of NVPR does not match Skia implementation. Review URL: https://codereview.chromium.org/1116123003
* Make uncached textures uncached from the get go.Gravatar bsalomon2015-01-14
| | | | | | | | This avoids the problem of a newly created uncached texture causing a purge of cached resources. BUG=chromium:445885 Review URL: https://codereview.chromium.org/846303002
* Add IndexType parameter to GrDrawTarget::drawPathsGravatar cdalton2014-11-25
| | | | | | | | | Allows the caller to decide whether they sent 8, 16, or 32 bit path indices. BUG=skia: Review URL: https://codereview.chromium.org/746253003
* Uses a single pre-baked set of paths for drawing nvpr text of a givenGravatar cdalton2014-09-18
typeface. Loads the paths using the driver's glyph loading routines. Refactors GrPathRange to accept a PathGenerator class that it uses to lazily initialize its paths. The client code is no longer expected to initialize the paths in a GrPathRange; instead it must provide a PathGenerator* instance to createPathRange(). Adds a new createGlyphs() method to GrPathRendering that creates a range of glyph paths, indexed by glyph id. GrPathRendering implements createGlyphs() with a PathGenerator that loads glyph paths using the skia frameworks. GrGLPathRendering uses glMemoryGlyphIndexArrayNV() instead, when possible, to load the glyph paths. Removes all GlyphPathRange logic from GrStencilAndCoverTextContext. It instead uses createGlyphs(). BUG=skia:2939 R=bsalomon@google.com, jvanverth@google.com Author: cdalton@nvidia.com Review URL: https://codereview.chromium.org/563283004