summaryrefslogtreecommitdiff
path: root/glamor/glamor_text.c
AgeCommit message (Collapse)AuthorFilesLines
2016-07-15glamor: Translate solid text background region after clippingMichel Dänzer1-6/+7
Fixes incorrect clipping for redirected windows which don't happen to be located at the top left corner of the screen. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96742 Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-01-29glamor: Simplify the pixmap box looping.Eric Anholt1-3/+5
We had a double loop across h and w, and passed the current x and y out to callers who then used w to multiply/add to an index. Instead, just single loop across w * h. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-01-13glamor: store old fonts in double width textures.Dave Airlie1-3/+7
There is a problem with some fonts that the height necessary to store the font is greater than the max texture size, which causes a fallback to occur. We can avoid this by storing two macro columns side-by-side in the texture and adjusting the calculations to suit. This fixes xfd -fn -*-*-*-*-*-*-*-*-*-*-*-*-*-* falling back here, when it picks -arabic-newspaper-medium-r-normal--32-246-100-100-p-137-iso10646-1 Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-05-14glamor: Adapt glamor_program API to handle render accelerationKeith Packard1-1/+1
This extends the existing API to support options needed for render accleration, including an additional fragment, 'combine', (which provides a place to perform the source IN mask operation before the final OP dest state) and an additional 'defines' parameter which provides a way to add target-dependent values without using a uniform. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-05-14glamor: Pass depth to glamor_pm_is_solid and glamor_set_planemaskKeith Packard1-1/+1
Instead of passing the destination drawable, just pass the depth, as the underlying functions need only that to check whether the planemask is going to work. This API change will allow higher level functions to not need the destination pixmap. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-24glamor: Just set the logic op to what we want at the start of all rendering.Eric Anholt1-7/+1
By dropping the unconditional logic op disable at the end of rendering, this fixes GL errors being thrown in GLES2 contexts (which don't have logic ops). On desktop, this also means a little less overhead per draw call from taking one less trip through the glEnable/glDisable switch statement of doom in Mesa. The exchange here is that we end up taking a trip through it in the XV, Render, and gradient-generation paths. If the glEnable() is actually costly, we should probably cache our logic op state in our screen, since there's no way the GL could make that switch statement as cheap as the caller caching it would be. v2: Don't forget to set the logic op in Xephyr's drawing. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2015-03-24glamor: Remove _nf rendering functionsKeith Packard1-39/+0
These were used by the non-standard glamor implementation in the intel driver. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-07-17glamor: Drop the "are we doing a series of blits or draws" logic.Eric Anholt1-6/+0
It's unused since keithp's copy acceleration code completely replaced glamor_copyarea.c and removed the blit path. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2014-05-05glamor: Work around libXfont when it fails to use defaultCharKeith Packard1-10/+24
GetGlyphs is supposed to always return the full list of characters when there is a default character available. However, if an application opens a 16-bit two dimensional font and then draws with 8-bit requests, the bitmapGetGlyphs function in libXfont versions up through 1.4.7 will return zero glyphs if there is no 0th row. While this is a bug in libXfont and should be fixed there, it's easy to protect glamor from it by simply falling through to the case that handles GetGlyphs failures for fonts without a default character. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-05glamor: Fix uxa-entry point for ImageText16Keith Packard1-1/+1
Was interpreting the incoming chars as 8-bits instead of 16-bits, resulting in the wrong characters being drawn. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-23glamor: Replace glamor_get/put_context() with just glamor_make_current().Eric Anholt1-8/+2
Now that we have the DIX global state for the current context, we don't need to track nesting to try to reduce MakeCurrent overhead. v2: Fix a mistaken replacement of a put_context with make_current in glamor_fill_spans_gl() (caught by keithp). Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (v1) Reviewed-by: Adam Jackson <ajax@redhat.com> (v1)
2014-04-03glamor: Add glamor_program based poly_text and image_textKeith Packard1-0/+526
Accelerates text painting with GPU-based geometry computation and stippling v2: Simplify get_glyphs, expand single character variable names to more descriptive ones. (Markus Wick) v3: Rebase against the glamor_prepare_* un-renaming (changes by anholt). Improves x11perf -f8text by 417.908% +/- 11.0144% (n=10) Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>