Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-03-31BLF: Perf: Add a kerning cache table for ascii chars.Clément Foucault
This adds less than a megabyte of mem usage. FT_Get_Kerning was the 2nd hotspot when profilling. This commit completly remove this cost. One concern though: I don't know if the kerning data is constant for every sizes but it seems to be the case. I tested different fonts at different dpi scalling and saw no differences.
2018-03-31Cleanup: blf internal struct namingCampbell Barton
- use x/y/width/height/max as a suffix. - replace 'num' prefix /w 'len' suffix.
2018-03-31Cleanup: BLF batch drawing namingCampbell Barton
- batching -> batch_draw. - ct & size -> len. - start/end -> begin/end (follow GL convention).
2018-03-30BLF: Add Batching capabilities.Clément Foucault
You can now use BLF_batching_start and BLF_batching_end to batch every drawcall to BLF together minimizing the overhead introduced by BLF and the opengl driver. These calls cannot be nested (for now). If the modelview matrix changes, previously batched calls are issued and a the process resume with the new matrix. However the projection matrix MUST not change and gl scissors as well.
2018-03-30BLF: Use Batch API instead of IMM.Clément Foucault
This is not a perfect win just yet. It's now calling glBufferSubData for every call (instead of using glMapBufferRange which is almost faster), but with this system we will be able to batch drawcalls together. See next commit.
2018-03-29BLF: Perf: Divide by 6 the amount of verts sent to the GPU.Clément Foucault
This means smaller imm buffer usage. This does not reduce the number of drawcalls. This uses geometry shader which is slow for the GPU but given we are really CPU bound on this case, it should not matter. A perfect implementation would: - Set the glyph coord in a bufferTexture and just send the glyph ID to the GPU to read the bufferTexture. - Use GWN_draw_primitive and draw 2*strllen triangle and just retrieve the glyph ID and color based on gl_VertexID / 6. - Stream fixed size buffer that the Driver can discard quickly but this is the same as improving IMM directly.
2018-03-26Merge branch 'master' into blender2.8Sergey Sharybin
2018-03-26BLF: Don't use user preferencesSergey Sharybin
BLF is a low level module, which might (and is) used without Blender. Thanks Campbell for review!
2018-03-26BLF: Cleanup, indentation inside of preprocessorSergey Sharybin
2018-03-25GPUTexture: Small refactor.Clément Foucault
This includes a few modification: - The biggest one is call glActiveTexture before doing any call to glBindTexture for rendering purpose (uniform value depends on it). This is also better to know what's going on when rendering UI. So if there is missing UI elements because of this commit look for this first. This allows us to have "less calls" to glActiveTexture (I did not measure the final count) and less checks inside GPU_texture. - Remove use of GL_TEXTURE0 as a uniform value in a few places. - Be more strict and use BLI_assert for bad usage of GPU_texture functions. - Disable filtering for integer and stencil textures (not supported by OGL specs). - Replace bools inside GPUTexture by a bitflag supporting more options to identify texture types.
2017-04-18Fix text drawing with core profileSergey Sharybin
The issue was going to the fact that GL_ALPHA was deprecated in core profile and common solution online is to use GL_RED instead. That is what is done in this commit.
2017-04-14Merge branch 'master' into blender2.8Bastien Montagne
Conflicts: source/blender/alembic/intern/abc_exporter.cc
2017-04-14BLF: avoid glyph cache use-after freeCampbell Barton
Causes crash if the font size isn't set after clearing (see T51200)
2017-04-10Get rid of last PRIM_QUAD usage, in blf_font.c/blf_glyph.c.Bastien Montagne
2017-04-04Immediate Mode: glPop/glPushClientAttribDalai Felinto
2016-10-16BLF/OpenGL: more text drawing optimizationMike Erwin
Make color values compact. Set color once per primitive. Use new immSkipAttrib to avoid useless color copies. All of this should make text drawing less CPU hungry.
2016-10-16BLF/OpenGL: accurate vertex count for drawingMike Erwin
We still need to BeginAtMost instead of simple Begin, since some glyphs could be clipped & not drawn.
2016-10-16BLF: make blurry text an optional (disabled) featureMike Erwin
While trying to simplify text drawing, noticed no Blender code uses the blur feature. Hopefully scripts don't use it!
2016-10-14OpenGL: draw text with fewer draw callsMike Erwin
Was one draw call per glyph, now one per line. Still room for improvement here.
2016-10-11BLF/OpenGL: draw text with new immediate modeMike Erwin
Part of T49043
2016-06-08GPU: fix/workaround basic shader font-colorCampbell Barton
All text was displaying black. BLF uses alpha-only textures which aren't supported by the basic-shader, Workaround this by using texture swizzle so the RGB components of the texture are set to 1.
2016-02-19Fix crash drawing fonts at size 1Campbell Barton
2015-12-08OpenGL: remove non-power-of-two texture check, where even ES 2.0 does not ↵Brecht Van Lommel
need it.
2015-12-08OpenGL: use sized texture internal formatsMike Erwin
Maybe this is pedantic but I read it’s best to explicitly set the desired component size. Also append “_ARB” to float texture formats since those need an extension in GL 2.1.
2015-04-20Cleanup: use bool /w flag checksCampbell Barton
2014-12-04Fix T42797: -Werror=sign-conversion Triggered in blf_glyph.cBastien Montagne
Very minor, but since it was reported...
2014-10-10Cleanup: (float)floor -> floorfCampbell Barton
2014-08-14hint checks to re-alloc as unlikelyCampbell Barton
also edit comments for knife tool
2014-07-16BLF: avoid float/int conversion drawing glyphsCampbell Barton
also use UNLIKELY for error cases
2014-01-19Docs: doxygen file descriptions for BLF, GPU and WMCampbell Barton
2014-01-16BLF: Fix for changing the DPI storing many fonts (300+)Campbell Barton
Each dpi value stores its own set of font sizes, so while dragging the dpi value would collect many sizes and never free. Also change how BLF_cache_clear works, it was freeing memory but not the OpenGL textures. Now just free all the cache and GL textures and let drawing allocate them again as needed.
2014-01-16BLF: avoid allocating empty array in blf_glyph_cache_textureCampbell Barton
2014-01-16Fix for BLF using realloc() on guarded-alloced memoryCampbell Barton
2013-09-01move strict compiler checks into a header so its easier to manage in one ↵Campbell Barton
place (pragmas were copied around). also enable more strict warnings for BLF (which had some incorrect casts).
2013-08-27ghash/bli-listbase edits, rename BLI_ghash_pop -> BLI_ghash_popkey (since it ↵Campbell Barton
takes a key as an arg and isnt popping any element from the hash as you might expect). add BLI_pophead/tail, since getting the first element from a list and removing it is a common task.
2013-08-11use 'greater/less then or equal to' operators rather then adding 1.Campbell Barton
2013-06-28Fix #35884: crash opening .blend with generated color grid image and preview ↵Brecht Van Lommel
render. Printing text on the color grid image would initialize font glyphs from a thread at the same time as the UI, causing conflicts. The freetype glyph renderer needs to be mutex locked because it uses a shared buffer internally even when rendering for different fonts. Also needed to change the image generate function to use the render monospace font to avoid conflicts in blenfont. What's still weak in the blenfont API is that there is no distinction between a font and a thread using that font to render with some particular size, style, etc.
2013-06-07text rendering: shadow offset was causing text to clip, now check for ↵Campbell Barton
clipping without the shadow since not-drawing characters because of subtle effect is rather annoying.
2013-05-12quiet sign conversion warnings and reduce sign conversion for BLI_string, ↵Campbell Barton
and BLF.
2013-04-29don't use GPU_extensions for BLF, its not initialized when using the ↵Campbell Barton
blender-playanim and not really needed. this reverts part of 55995
2013-04-12Add function to query maximum texture size. Also, make texture uploadAntony Riakiotakis
functions aware of this limit.
2013-01-23UI todo:Ton Roosendaal
Added "Panel Title" style to Theme settings. Allows to make these nice larger or draw differently. Also tried to put hinting in Style, but this needs to be a per-font setting. uiFont data is still not being saved (also not allowing to set own font files for UI). That's a todo for 267 then.
2013-01-08use guarded malloc for blf textureCampbell Barton
2013-01-04code cleanup, also remove glError check in font drawing code since its now a ↵Campbell Barton
debug option.
2013-01-03fix for bug rendering text at small sizes, padding was incorrectly being ↵Campbell Barton
applied to the characters y offset causing out of bounds pixels to be requested from glTexSubImage2D(). also clamp width, height of the character bitmap to the bitmap bounds since this can still happen for very small text (2-3 pixels high).
2012-09-15code cleanup: replace macro for BLI_rect size/center with inline functions.Campbell Barton
2012-08-23code cleanup: rename BLI_in_rctf() --> BLI_rctf_isect_pt(), to conform with ↵Campbell Barton
our naming convention.
2012-08-21code cleanup: includes and correction for macroCampbell Barton
2012-08-20macros for rectangle center and sizeCampbell Barton
2012-05-11style cleanup: whitespaceCampbell Barton