Commit Graph

330 Commits

Author SHA1 Message Date
Harley Acheson
98b67d30ff Fix T64076: color ramp overlaps scrollbar
Differential Revision: https://developer.blender.org/D4831
2019-05-09 19:55:10 +02:00
28ada66f38 Cleanup: long function call in interface_draw.c 2019-05-01 12:08:06 +02:00
56b0cd1db6 Fix T63605: Assert squeezing a template_curve_mapping in a panel to
almost zero horizontally

Reviewers: brecht

Maniphest Tasks: T63605

Differential Revision: https://developer.blender.org/D4690
2019-04-25 21:59:05 +02:00
4439e5d0ba Cleanup: add trailing commas to avoid right shift 2019-04-18 17:19:44 +02:00
41d4a19865 ClangFormat: format '#if 0' code in source/ 2019-04-17 08:24:14 +02:00
e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
e86e0aad55 Cleanup: use braces for interface code 2019-03-25 11:16:46 +11:00
ed9af18c76 GPU: Replace glEnable/glDisable but GPU_state calls 2019-03-23 23:43:26 +01:00
875b50f94f UI: Fix curve extention filling on curve widgets 2019-03-22 03:53:21 +01:00
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
796abc90a8 Fix T58090: Selected curve vertex should stand out
D4002 by @slumber w/ edits.

Use text colors, blending to background if they don't contrast.
2019-02-15 11:58:36 +11:00
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
744f633986 Cleanup: trailing commas
Needed for clan-format not to wrap onto one line.
2019-02-03 14:59:11 +11:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
68cab3aff6 Cleanup: replace attrib w/ attr
Also rename GPUVertexAttribs to GPUVertAttrLayers,
avoids confusion with GPUVertAttr which isn't closely related.
2019-01-29 08:32:25 +11:00
b8e8c0e325 Cleanup: comment line length (editors)
Prevents clang-format wrapping text before comments.
2019-01-15 23:30:31 +11:00
e305560f13 Cleanup: add trailing commas to structs
Needed for clang formatting to workaround bug/limit, see: T53211
2019-01-07 00:34:48 +11:00
53d655a0b3 Cleanup: use typed unsigned ints 2019-01-04 11:06:44 +11:00
54a4c1cf35 UI: refactor layout vars out of uiFontStyle
Word wrap and alignment layout args only used by UI_fontstyle_draw
were vars in uiFontStyle.
These were written to before drawing, so better pass as an argument.

Pass uiFontStyle & uiWidgetColors as const args.
2019-01-04 11:00:48 +11:00
6601a89650 Fix T58549, T56741: HSV color picker issues with Filmic view transform.
In 2d655d3 the color picker was changed to use display space HSV values.
This works ok for a simple sRGB EOTF, but fails with view transforms like
Filmic where display space V 1.0 maps to RGB 16.292.

Instead we now use the color_picking role from the OCIO config when
converting from RGB to HSV in the color picker. This role is set to sRGB
in the default OCIO config.

This color space fits the following requirements:

* It is approximately perceptually linear, so that the HSV numbers and
  the HSV cube/circle have an intuitive distribution.
* It has the same gamut as the scene linear color space.
* Color picking values 0..1 map to scene linear values in the 0..1 range,
  so that picked albedo values are energy conserving.
2018-12-13 19:25:45 +01:00
49490e5cfb Merge branch 'master' into blender2.8 2018-12-12 13:02:09 +11:00
2699ababa9 Cleanup: style 2018-12-01 19:55:52 +11:00
c34c688b47 Fix build: min and max not found. 2018-11-12 19:36:31 +03:00
c199040438 UI: Scale control points on curve map when zooming
Mentioned by Pablo on Blender Today : https://www.youtube.com/watch?v=67NIL5A-07c @ about 27:47

Differential Revision: https://developer.blender.org/D3902
2018-11-12 14:18:35 +00:00
9361c1c83d UI: Add back line to curve map
D3894 by @charlie with edits
2018-11-05 13:04:43 +11:00
bc870f17a7 Cleanup: style, shadow warning 2018-11-04 10:10:00 +11:00
f2858fbb9a UI: Draw curve map with solid color
Differential Revision: https://developer.blender.org/D3891
2018-11-03 17:42:40 +00:00
e7218e7049 Cleanup: naming
- immAttrib*    -> immAttr*
- immSkipAttrib -> immAttrSkip

Term 'attr' is a convention for GPU module.
2018-10-09 11:01:50 +11:00
ae57383648 Cleanup: comment blocks 2018-09-02 18:28:27 +10:00
8cd7828792 GWN: Port to GPU module: Replace GWN prefix by GPU 2018-07-18 11:49:15 +02:00
57ab7daa2a GPU_matrix: use Blender's naming conventions
Thanks to @sergey for review
2018-07-15 15:34:13 +02:00
09431033e9 Cleanup: split GPU_batch
Split out presets and utilities for creating batches.
These functions are quite specialized and not related to typical usage.
2018-07-15 10:51:49 +02:00
73d2d75eed Cleanup: rename 'ct' to 'len' for editors 2018-07-08 13:19:10 +02:00
6d72d3c862 Cleanup: abbreviate unsigned types (editors, wm) 2018-07-08 12:49:36 +02:00
9f80429ab6 Cleanup: use _f, _i suffix for GPU state API 2018-07-02 18:27:05 +02:00
37994e0af2 Merge branch 'master' into blender2.8 2018-07-01 20:15:21 +02:00
26c5a1c301 Cleanup: right shift in interface code 2018-07-01 20:12:07 +02:00
b4998548ab Cleanup: use '_len' suffix for line stipple 2018-07-01 08:42:16 +02:00
8e02106d0d GLRefactor: partially remove gl calls from source/blender/editors.
This translates the gl calls to the new GPU_ wrappers from D3501.

Given it's tedious and repetitive work, this patch does as much as it can with search + replace, the remainder of the gl calls will need to be manually dealt with on a case by case basis.

This fixes 13 of the 28 failing editors when building without opengl.

For the list of substitutions see D3502

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3502
2018-06-27 19:07:23 -06:00
e92baab348 Merge branch 'master' into blender2.8 2018-05-23 10:51:11 +02:00
d886e32270 Cleanup: strip trailing space from interface files 2018-05-23 10:48:50 +02:00
Dalai Felinto
d64f12248a Initialize alpha discard for uiWidgetBaseParameters
No functional change, just playing safe and documenting how to
initialize the parameter in most of the cases.
2018-05-03 09:59:48 +02:00
d09920687c Merge branch 'master' into blender2.8 2018-05-02 12:46:14 +02:00
128506eeb1 BLI Color: YUV to/from rgb colorspace option
This commit does two things:

- Adds an option to do the calculation in different color spaces (BT601
or BT709).
- Changes the default caluclation from legacy BT601 to BT709.

This affects several areas:

- UI areas (mainly scopes)
- ViewLevelsNode
- Several other nodes that use `COM_ConvertOperation.h`
2018-04-29 18:00:45 -04:00
e01cadd657 WM: new offscreen window draw method to replace all existing methods.
For Blender 2.8 we had to be compatible with very old OpenGL versions, and
triple buffer was designed to work without offscreen rendering, by copying
the the backbuffer to a texture right before swapping. This way we could
avoid redrawing unchanged regions by copying them from this texture on the
next redraws. Triple buffer used to suffer from poor performance and driver
bugs on specific cards, so alternative draw methods remained available.

Now that we require newer OpenGL, we can have just a single draw method
that draw each region into an offscreen buffer, and then draws those to
the screen. This has some advantages:

* Poor 3D view performance when using Region Overlap should be solved now,
  since we can also cache overlapping regions in offscreen buffers.
* Page flip, anaglyph and interlace stereo drawing can be a little faster
  by avoiding a copy to an intermediate texture.
* The new 3D view drawing already writes to an offscreen buffer, which we
  can draw from directly instead of duplicating it to another buffer.
* Eventually we will be able to remove depth and stencil buffers from the
  window and save memory, though at the moment there are still some tools
  using it so it's not possible yet.
* This also fixes a bug with Eevee sampling not progressing with stereo
  drawing in the 3D viewport.

Differential Revision: https://developer.blender.org/D3061
2018-04-27 12:14:14 +02:00
1a33707417 UI: Fix waveform widget text drawing.
Flush the text cache so that we have proper scissor test and ordering.
2018-04-07 14:03:32 +02:00
4a73127a2b UI: Perf: Improve ui_draw_dropshadow.
Replace the 12 iterations of UI_draw_roundbox_4fv with only one batch.

This mean less overdraw and less drawcalls.

I had to hack the opacity falloff curve manually to get approximatly the
same result as previous technique. I'm sure with a bit more brain power
somebody could find the perfect function.
2018-04-06 10:25:53 +02:00
80d4d71360 UI: Perf: Modify UI_draw_roundbox to use GWN_batch API.
This commit also rename and move a few thing to clean things up.

Major improvment is using one drawcall instead of 8 for UI_draw_roundbox_aa.
2018-04-06 10:25:53 +02:00
618bc6c679 GPU: use alpha blend that works for drawing to transparent buffer.
It's unlikely to ever be intentional to square the source alpha, as happens
with glBlendFunc, so this changes the blending throughout the code.
2018-02-14 14:00:57 +01:00
afb213f876 Code cleanup: fix incorrect reading of GL scissor coordinates.
These are often the same as the viewport, but not always.
2018-02-13 20:02:31 +01:00