Commit Graph

472 Commits

Author SHA1 Message Date
Michael Natterer dd0098524f app: add a little hint about reporting bugs against unstable git 2014-05-27 21:58:10 +02:00
Michael Natterer 91bb872d26 app: write "Unstable Development Version" across the empty image window 2014-03-07 11:33:14 +01:00
Michael Natterer 462f61794e app: fix drawing of the empty canvas wilber 2013-09-28 18:00:31 +02:00
Michael Natterer 77e70f3550 app: remove the manual double buffering from the canvas
It is messing with overlay widgets. Is was effectively disabled since
cairo tool drawing was introduced, but not completely.
2013-04-28 14:56:07 +02:00
Michael Natterer aea94211b1 app: add an unrotated canvas item group to GimpDisplayShell
and put the software cursor and the tool progress there.
2013-04-24 00:01:01 +02:00
Michael Natterer b3a9a6a3e3 Bug 55367 - Rotated view of the canvas (view is rotated, not image contents)
First version of display rotation, inspired by gimp-painter.
The rotation always happens around the image's center.

The only "UI" for rotating is currently shift+middle-drag and
shift+space-drag. Control constrains the angle to 15 degrees
and is currently the only way to go back to "no rotation".
2013-04-20 15:11:01 +02:00
Michael Natterer 057ec9ac4a app: remove rectangle parameters from gimp_display_shell_draw_checkerboard()
because the cairo_t is already clipped to the right extents.
2013-04-20 10:47:13 +02:00
Michael Natterer 9785c4e1a3 app: simplify gimp_display_shell_canvas_draw_image() a lot
by not manually intersecting and subtracting regions at all. Simply
clip the cairo_t to the area we want to render, it will automatically
intersect with the clip region from the expose event, and check if the
clip is empty before actually drawing anything.
2013-04-19 02:23:38 +02:00
Michael Natterer c3b53b8b66 app: move the "get scaled image size" functions from shell-draw to -scale 2013-04-18 19:06:17 +02:00
Michael Natterer fd6c5dd576 app: port the image and wilber drawing code away from GdkRegion
the changes are simply copied from the gtk3-port branch, reducing the
number of diffs, and enabling hacking on drawing stuff in master while
keeping the branch easily rebasable.
2013-04-18 11:56:43 +02:00
Michael Natterer b8e96c7141 app: rename gimpdisplay-transport.[ch] to gimpdisplayxfer.[ch]
so it matches the name of the stuff it implements.
2013-02-03 13:26:32 +01:00
Michael Natterer d0a5879f28 app: some GIMP-style cleanup to the last commit 2013-02-02 17:07:03 +01:00
Chris Wilson 4a81849e36 app: Use SHM transport for data transfer for display
Recent Cairo uses SHM transports when available, and exposes the ability
for its users to manage images shared between it and the display.
This allows us to eliminate copies, and if the architecture supports it
even to upload directly into GPU addressable memory without any copies
(all in normal system memory so we suffer no performance penalty when
applying the filters). The caveat is that we need to be aware of the
synchronize requirements, the cairo_surface_flush and
cairo_surface_mark_dirty, around access to the transport image. To
reduce the frequency of these barriers, we can subdivide the transport
image into small chunks as to satisfy individual updates and delay the
synchronisation barrier until we are forced to reuse earlier pixels.

Note this bumps the required Cairo version to 1.12, and please be aware
that the XSHM transport requires bug fixes from cairo.git (will be
1.12.12)

v2: After further reflections with Mitch, we realized we can share the
transport surface between all canvases by attaching it to the common
screen.

v3: Fix a couple of typos in insert_node() introduced when switching
variables names.

v4: Encapsulating within an image surface rather than a subsurface was
hiding the backing SHM segment from cairo, causing it to allocate
further SHM resources to stream the upload. We should be able to use a
sub-surface here, but it is more convenient to wrap the pixels in an
image surface for rendering the filters (and conveniently masking the
callee flushes from invalidating our parent transport surface).

Cc: Michael Natterer <mitch@gimp.org>
2013-02-02 13:59:59 +01:00
Michael Natterer 53cf2c657b app: move the GTK-free cairo utility functions to core/gimp-cairo.[ch] 2012-05-02 17:51:02 +02:00
Michael Natterer f1d4dde36a libgimpwidgets: add gdk_event_triggers_context_menu() to gimp3migration.[ch]
and remove gimp_button_event_triggers_context_menu() again. Update
all callers to use the new function.
2011-10-02 16:23:59 +02:00
Michael Natterer d92cd2f6c8 Add gimp_button_event_triggers_context_menu() and use it
instead of checking for event->button == 3, so context menus
work correctly on the Mac. Didn't change the image menu yet
because thet requires some more refactoring.
2011-09-19 00:47:23 +02:00
Michael Natterer f09be52c1b app: turn the transform preview into a GimpCanvasItem
And remove all the complicated handling code entirely. This makes
GimpTransformTool a lot less complex. As a nice side effect, the
preview is now always 100% in sync with the grid and handles.
2011-03-27 16:40:41 +02:00
Michael Natterer a5549ece52 app: don't pause/resume the shell (and the active tool) around expose()
This was only there to make sure XOR drawing works, and is now
complete overhead since cairo drawing is done *in* expose, and not in
some hack around it.
2011-03-25 21:28:21 +01:00
Michael Natterer de8a07703a app: name display scrollbar callbacks like the signal they are handling
instead of calling them all foo_update() which means absolutely nothing.
Also rename nav_button_press() to navigation_button_press().
2011-02-24 02:15:53 +01:00
Michael Natterer c09ad998a4 app: split tool event handling out into an own file
it was simply getting too hairy in the callbacks.c file.
2011-02-24 02:15:53 +01:00
Michael Natterer 09947733d6 app: use some of the new GDK_KEY_foo #defines from GTK+ 2.22
and use them in gimpdisplayshell-callbacks.c so I can do some
refactoring there without making rebasing the gtk3-port branch almost
impossible.
2011-02-24 02:15:53 +01:00
Michael Natterer ac9ffde880 app: formatting and other minor cleanups 2011-02-22 16:27:18 +01:00
Michael Natterer 4030e3f446 app: make gimp_display_shell_flush_event_queue() private 2011-02-20 16:58:37 +01:00
Michael Natterer 9151899aab app: move variable to local scope in gimp_display_shell_canvas_tool_events() 2011-02-20 16:33:46 +01:00
Michael Natterer 36cc10c4dc app: rename gimp_display_shell_[un]transform_coordiante() to _coords() 2011-02-20 16:29:20 +01:00
Michael Natterer 4bf3a136e0 app: factor out GimpDisplayShell tool event retrieval and untransforming 2011-02-20 16:23:17 +01:00
Michael Natterer d300882401 app: factor out GimpDisplayShell cursor updating to a utility function 2011-02-20 15:38:58 +01:00
Michael Natterer f7bb5f460c app: rename the functions dealing with GimpDisplayShell's software cursor
to gimp_display_shell_foo_software_cursor() in order to remove
confusion with the functions that deal with the windowing system's
cursor.
2011-02-20 14:46:52 +01:00
Michael Natterer d504eeb048 app: move GimpDisplayShell pointer/keyboard grabbing to utility functions
Spit warnings in the functions if grabbing fails and return a boolean
success value. Bail out in the callers upon grab failure instead of
assuming that grabbing always succeeds and running into an
inconsistent state that can cause all sorts of problems.
2011-02-20 12:12:48 +01:00
Michael Natterer 748fac5c00 app: g_printerr() a warning if grabbing fails
This should not happen, but happens anyway on GTK+ 3.x, so better warn
about it to make debugging easier.
2010-12-07 19:57:13 +01:00
Michael Natterer 458230bf8d app: use a GimpCanvasPassePartout for drawing the crop highlight
and remove all old drawing logic.
2010-11-12 19:47:51 +01:00
Michael Natterer f8d6821790 app: get rid of selection_control() in core/ and display/
- replace gimp_display_shell_selection_control() by undraw() and restart()
  which actually say what they are doing
- remove enum GimpSelectionControl
- replace GimpImage::selection_control() by ::selection_invalidate()
  because none of the other enum values was used any longer
2010-10-09 20:28:37 +02:00
Michael Natterer 914ac9aa11 app: no need to cairo_save()/restore() around drawing a canvas item 2010-10-08 16:13:21 +02:00
Michael Natterer 55f01bf6f3 app: remove gimp_display_shell_draw_vectors()
which is the last bit of non-item drawing of stuff that is not
somehow the image itself... wheee!

This involves reverting commit
6bce0641d4 and adding back all the
vectors handlers that were in gimpdisplayshell-callbacks.c before.
Change the callbacks to manage proxy items for all the image's
vectors.
2010-10-08 01:03:56 +02:00
Michael Natterer 1d45f6295e app: add a software cursor canvas item
and use it to draw the sw cursor. Almost every aspect of the old code
was ugly and hard to read, this is so much nicer...
2010-10-02 21:56:36 +02:00
Michael Natterer 502d7c815b app: add a canvas grid item class and use it to draw the grid
Remove gimp_display_shell_draw_grid().
2010-10-02 20:57:40 +02:00
Michael Natterer d3f19baf0d app: remove "shell" parameter from GimpCanvasItem's public APIs
because each item has a shell now. Keep the parameter in the virtual
functions though because that saves a lot of code in the subclasses.
2010-10-01 14:54:53 +02:00
Michael Natterer 26d0035be0 app: draw guides using GimpCanvasItems
- Add signals GimpImage::guide_added(), removed() and moved()
- Remove singal GimpImage::update_guide()
- Adapt core code to emit the new signals instead of update_guide()
- Have the shell connect to the new signals and update guide canvas
  items as needed
- Remove gimp_display_shell_draw_guides()
2010-10-01 10:34:15 +02:00
Michael Natterer 0c613ba87d app: port sample point drawing to GimpCanvasItems
- Add GimpImage signal "sample-point-moved" and emit it when needed
- Let the shell connect to the sample point add, remove and move signals
  and update the canvas items accordingly
- Remove gimp_display_shell_draw_sample_points()
2010-10-01 09:27:57 +02:00
Michael Natterer 7edfa2ca54 app: start an infrastructure where the shell keeps around its canvas items
- Invalidate the proper area when an item gets added or removed.
- Draw the kept canvas items instead of calling a draw tool function.
- The draw tool now sets its item on the shell.
2010-09-29 22:12:01 +02:00
Michael Natterer 42e137fc74 app: rename gimp_display_shell_draw_area() to draw_image() 2010-09-29 20:58:13 +02:00
Sven Neumann eb5bb6363e app/display: draw the crop highlight using cairo
Instead of dimming the actual pixels, apply a translucent fill to
the area outside the highlight rectangle.
2010-09-29 20:34:59 +02:00
Sven Neumann ccee0ec41a app/display: let cairo render the checkerboard
Instead of blending the scaled image data onto the checkerboard and
then painting this image to the screen, render the image data into
an ARGB cairo image surface. Then paint a checkerboard on the canvas
and the image on top of it.
2010-09-29 20:34:59 +02:00
Michael Natterer f284e5f748 app: don't draw the draw tool's items to the wrong display 2010-09-26 16:56:26 +02:00
Michael Natterer c058ec93ee app: temporarily enable double buffering unconditionally 2010-09-23 00:11:18 +02:00
Michael Natterer 1ea16c0770 app: draw the active tool's stuff in the display expose handler 2010-09-22 22:24:22 +02:00
Michael Natterer 8a029f3e4e app: enable double buffering when editing vectors 2010-09-17 23:12:42 +02:00
Sven Neumann 4c57e3f19e app: port GimpVectors drawing to cairo
This is just a rough proof of concept. More changes are about
to follow.
2010-09-16 21:13:08 +02:00
Michael Natterer fd14818035 app: port GimpDisplayShell transform preview drawing to cairo 2010-09-08 19:32:22 +02:00
Michael Natterer 274f210e4c app: remove obsolete includes 2010-08-28 15:33:25 +02:00