summaryrefslogtreecommitdiffstats
path: root/base/gfx
Commit message (Collapse)AuthorAgeFilesLines
* Headers cleanup:phajdan.jr@chromium.org2009-07-236-14/+24
| | | | | | | | | - reduce header dependencies by using bookmark_model_observer.h - replace #include <iostream> by #include <iosfwd> in headers Review URL: http://codereview.chromium.org/159280 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21444 0039d316-1c4b-4281-b951-d872f2087c98
* Changing the include from "base/gfx/platform_canvas.h" to ↵ajwong@chromium.org2009-07-225-55/+0
| | | | | | | | | | | | "skia/ext/platform_canvas.h" BUG=None TEST=None Review URL: http://codereview.chromium.org/159057 Patch from Thiago Farina <thiago.farina@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21258 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 20516 by re-landing this previous patch.brettw@chromium.org2009-07-171-2/+2
| | | | | | | | | | | | | Keep the cairo clipping region in sync with the Skia one. The PlatformCanvas now tracks this, so we don't need to have the similar code in gfx::Canvas. I moved most references of cairo_surface_t to cairo_t since the cairo_t has a transform and clip but the surface does not. Review URL: http://codereview.chromium.org/149409 Review URL: http://codereview.chromium.org/155700 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20992 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r20553.thestig@chromium.org2009-07-131-2/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20554 0039d316-1c4b-4281-b951-d872f2087c98
* Additional svn ignores for native_client and Makefile.thestig@chromium.org2009-07-131-2/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20553 0039d316-1c4b-4281-b951-d872f2087c98
* Revert previous clipping rect change for Cairo to see if it fixes the build.brettw@chromium.org2009-07-131-2/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20516 0039d316-1c4b-4281-b951-d872f2087c98
* Keep the cairo clipping region in sync with the Skia one.brettw@chromium.org2009-07-131-2/+2
| | | | | | | | | | The PlatformCanvas now tracks this, so we don't need to have the similar code in gfx::Canvas. I moved most references of cairo_surface_t to cairo_t since the cairo_t has a transform and clip but the surface does not. Review URL: http://codereview.chromium.org/149409 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20499 0039d316-1c4b-4281-b951-d872f2087c98
* Make converting from NativeViewId to NativeView an error on Mac.shess@chromium.org2009-07-081-1/+10
| | | | | | | | Goal is to prevent someone from checking in new cross-platform code relying on this. Review URL: http://codereview.chromium.org/149342 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20193 0039d316-1c4b-4281-b951-d872f2087c98
* GdkPixbufFromSkBitmap needs to un-premultiply the alpha beforetc@google.com2009-07-081-4/+30
| | | | | | | | | | passing off the data to gdk_pixbuf. This is required in the theme code for tinted bitmaps. Review URL: http://codereview.chromium.org/150151 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20164 0039d316-1c4b-4281-b951-d872f2087c98
* linux: OOP windowed pluginsevan@chromium.org2009-07-071-3/+3
| | | | | | | | | | | | | | There are still a few issues, but that's a start. - only windowed plugins - we can't currently create the gtksocket in background tabs, because their gtkwidgets are not yet in the hierarchy, so they can't be realized (that's what gives the XID). - the plugin process talks to the browser process through the renderer process to create/destroy the gtksockets, because the plugin doesn't know which renderer it's talking to. We need a bit more plumbing to be able to have direct IPC. - some code is duplicated between chrome and test_shell. We should probably refactor it, but I'm not sure where the common part should live. Patch from Antoine Labour <piman@google.com>, with some touchups by me. Review URL: http://codereview.chromium.org/146078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20041 0039d316-1c4b-4281-b951-d872f2087c98
* Fix retarded bitmath. << 8 != * 255glen@chromium.org2009-07-072-6/+10
| | | | | | | | BUG=13360 Review URL: http://codereview.chromium.org/149164 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20040 0039d316-1c4b-4281-b951-d872f2087c98
* Reland of r19131, this time with real Math:glen@chromium.org2009-06-302-3/+65
| | | | | | | | | | | | | | | PNGDecoder wasn't multiplying the alpha like PNGEncoder was. This lead to color overflow. This intermediate fix makes everything correct, but will make alphaed pixels slightly darker until the user's cache is flushed (I have screenshots of the effect). BUG=13360 TEST=Run base_unittests.exe --gtest_filter=*PNG* Review URL: http://codereview.chromium.org/150107 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19589 0039d316-1c4b-4281-b951-d872f2087c98
* linux plugins: eliminate GtkWidget* from plugin processevan@chromium.org2009-06-261-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | [retry with mac hopefully fixed this time] GtkWidget* (and its wrapper, gfx::NativeView) only work within a single process. Plugins already work with a lower-level type that works across processes -- an X Window id. The parent of a plugin is an HWND on windows, but it's an X Window id on X. So we introduce a new typedef wrapping that and push it through all the places in the code that needs it. Since we no longer have a GtkSocket in the WebPluginDelegateImpl, we need to do a bit more work in the WebViewDelegate (aka the browser process in the multiproc world). We also need the plugin host (the browser) to track the GtkSockets that are hosting the plugin, as well as destroy them when necessary. To do this we require the plugin owner to grab the plug-removed signal rather than putting its handler in GtkPluginContainer; this is the way it worked before I'd refactored into GtkPluginContainer so it shouldn't be so bad. This change still only works in test_shell, but the refactoring should translate to the multiprocess case pretty easily. Review URL: http://codereview.chromium.org/146009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19387 0039d316-1c4b-4281-b951-d872f2087c98
* Revert all of my patches from today.evan@chromium.org2009-06-261-13/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19328 0039d316-1c4b-4281-b951-d872f2087c98
* mac: retry build fix.evan@chromium.org2009-06-261-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19327 0039d316-1c4b-4281-b951-d872f2087c98
* linux plugins: eliminate GtkWidget* from plugin processevan@chromium.org2009-06-261-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | GtkWidget* (and its wrapper, gfx::NativeView) only work within a single process. Plugins already work with a lower-level type that works across processes -- an X Window id. The parent of a plugin is an HWND on windows, but it's an X Window id on X. So we introduce a new typedef wrapping that and push it through all the places in the code that needs it. Since we no longer have a GtkSocket in the WebPluginDelegateImpl, we need to do a bit more work in the WebViewDelegate (aka the browser process in the multiproc world). We also need the plugin host (the browser) to track the GtkSockets that are hosting the plugin, as well as destroy them when necessary. To do this we require the plugin owner to grab the plug-removed signal rather than putting its handler in GtkPluginContainer; this is the way it worked before I'd refactored into GtkPluginContainer so it shouldn't be so bad. This change still only works in test_shell, but the refactoring should translate to the multiprocess case pretty easily. Review URL: http://codereview.chromium.org/146009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19320 0039d316-1c4b-4281-b951-d872f2087c98
* change backing store cache to be memory-based rather than counterikkay@chromium.org2009-06-251-0/+2
| | | | | | | | | BUG=13763 TEST=none Review URL: http://codereview.chromium.org/146095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19246 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 19131.glen@chromium.org2009-06-242-68/+3
| | | | | | Review URL: http://codereview.chromium.org/147095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19154 0039d316-1c4b-4281-b951-d872f2087c98
* PNGDecoder wasn't multiplying the alpha like PNGEncoder was. This lead to colorglen@chromium.org2009-06-242-3/+68
| | | | | | | | | | | | | | overflow. This intermediate fix makes everything correct, but will make alphaed pixels slightly darker until the user's cache is flushed (I have screenshots of the effect). BUG=13360 TEST=none Review URL: http://codereview.chromium.org/147049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19131 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor the PlatformContext layer to have only one class.brettw@chromium.org2009-06-142-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Previously we had three classes of PlatformCanvas*, one for each platform. Then we had a typedef of PlatformContext to PlatformCanvas[Mac|Win|Linux] for the specific platform. This means that it was almost impossible to forward-declare PlatformCanvas and there were a bunch of unnecessary includes of platform_canvas.h in header files. This change makes there be only one platform_canvas.h header with ifdefs, which removes a decent amount of duplicated code. There is a platform-independent file, and one platform-dependent file of platform_canvas for each platform. I also renamed PlatformDevice[Mac|Win|Linux] to PlatformDevice, althouth in this case I kept the separate headers since there was much less overlap. I also broke out CanvasPaint into separate headers so this template doesn't need to be included all over the project (only a couple of files actually need it). Review URL: http://codereview.chromium.org/125109 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18363 0039d316-1c4b-4281-b951-d872f2087c98
* Liberalize the size limits in the PNG decoder to match the changes landed ↵pkasting@chromium.org2009-06-091-5/+7
| | | | | | | | | | upstream to all the WebKit image decoders. I'm not sure where this is used, hence no test. BUG=3643 TEST=none Review URL: http://codereview.chromium.org/118462 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17988 0039d316-1c4b-4281-b951-d872f2087c98
* A new menu system for views.ben@chromium.org2009-06-081-0/+3
| | | | | | | | This is all the functionality needed for the page, app menus and browser system menus. Review URL: http://codereview.chromium.org/119237 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17895 0039d316-1c4b-4281-b951-d872f2087c98
* Re-Retry. This is the change from hell.glen@chromium.org2009-06-061-5/+34
| | | | | | | | | | | | | | | | | | | | | | | Revert DCHECKs to what they used to be - turns out a bunch of stuff in the code depended on input.empty() == true. --- I believe the code (with your width() * bbp fix) is correct. The UMR errors occur when the source image contain alpha. I believe the issue comes from webkit glue image decoder, and the reason this only started triggering valgrind errors is that the old ones were masked by the change detailed in bug 12640 Also adds valgrind suppression for the new code. TBR=Nick BUG=12891,12640 TEST=none Review URL: http://codereview.chromium.org/119271 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17811 0039d316-1c4b-4281-b951-d872f2087c98
* Revert pngencoder changes.glen@chromium.org2009-06-051-36/+5
| | | | | | | BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17803 0039d316-1c4b-4281-b951-d872f2087c98
* Fix pngencoder mac perf errors - the previous code was never actually doing ↵glen@chromium.org2009-06-051-4/+3
| | | | | | | | | | | | an input.empty() check. BUG=none TEST=none TBR=nick Review URL: http://codereview.chromium.org/118343 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17801 0039d316-1c4b-4281-b951-d872f2087c98
* Retry. I believe the code (with your width() * bbp fix) is correct.glen@chromium.org2009-06-051-5/+37
| | | | | | | | | | | | | The UMR errors occur when the source image contain alpha. I believe the issue comes from webkit glue image decoder, and the reason this only started triggering valgrind errors is that the old ones were masked by the change detailed in bug 12640 Also adds valgrind suppression for the new code. BUG=12891,12640 TEST=none Review URL: http://codereview.chromium.org/118297 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17792 0039d316-1c4b-4281-b951-d872f2087c98
* Revert png encoder changes.glen@chromium.org2009-06-041-40/+4
| | | | | | | | | BUG=none TEST=none TBR=nick git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17688 0039d316-1c4b-4281-b951-d872f2087c98
* Twiddle some bits to get PNGEncoder to match ImageOperations. There's a ↵glen@chromium.org2009-06-041-9/+16
| | | | | | | | | | | Valgrind error that doesn't yet make sense. BUG=none TEST=none TBR=willchan git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17680 0039d316-1c4b-4281-b951-d872f2087c98
* Attempt to fix memory leak again.glen@chromium.org2009-06-041-1/+1
| | | | | | | | | BUG=none TEST=none TBR=willchan git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17635 0039d316-1c4b-4281-b951-d872f2087c98
* Fix bustage by defining NativeCursor on Mac.ben@chromium.org2009-06-041-0/+1
| | | | | | | | | TBR=glen BUG=none TEST=none Review URL: http://codereview.chromium.org/118223 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17618 0039d316-1c4b-4281-b951-d872f2087c98
* Replace HCURSOR usage in views::View with a new gfx::NativeCursor type that ↵ben@chromium.org2009-06-041-0/+3
| | | | | | | | | | | | | also supports GdkCursor*, and wires this up with the existing implementors of the GetCursorForPoint method. This allows us to get rid of one of the most annoying NOTIMPLEMENTED()s in views-gtk. BUG=none TEST=none Review URL: http://codereview.chromium.org/119150 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17614 0039d316-1c4b-4281-b951-d872f2087c98
* Fix leak in PNGEncoder.glen@chromium.org2009-06-041-10/+10
| | | | | | | | | | | R=willchan BUG=none TEST=none Review URL: http://codereview.chromium.org/119147 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17603 0039d316-1c4b-4281-b951-d872f2087c98
* PNGEncoder wasn't accounting for SkBitmap's premultiplied alpha (PNGDecoder ↵glen@chromium.org2009-06-041-4/+33
| | | | | | | | | | was, however). BUG=12891 Review URL: http://codereview.chromium.org/118106 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17590 0039d316-1c4b-4281-b951-d872f2087c98
* Merge app/gfx/gtk_util into base/gfx/gtk_util.thestig@google.com2009-06-032-0/+37
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/118174 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17535 0039d316-1c4b-4281-b951-d872f2087c98
* Fix memory leak in corrupt JPEG decoding.thestig@chromium.org2009-05-191-2/+2
| | | | | | | BUG=10945 Review URL: http://codereview.chromium.org/113433 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16352 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: Take download shelf and infobar close animations into account during ↵estade@chromium.org2009-05-151-3/+3
| | | | | | | | | | render view sizing. http://crbug.com/11080 Review URL: http://codereview.chromium.org/113322 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16193 0039d316-1c4b-4281-b951-d872f2087c98
* This CL updates chrome to the latest version of skia, retrieved via DEPS, andsenorblanco@chromium.org2009-05-135-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | placed in third_party. All relevant skia changes (for all 3 platforms) have been upstreamed. Most of this CL is mind-numbingly repetitive. Things of interest are: skia.gyp (now points at third_party versions), DEPS, and SkUserConfig.h. stdint.h: Skia now requires C99 integer types, which MSVC doesn't support natively. I have put typedefs in config/win/stdint.h. Note that the new version of skia appears to render rects whose coordinates are "backwards" (ie., x2 < x1 or y2 < y1), which were formerly culled. There were a couple obvious instances of this in the code which I fixed, but there may be more. There were ~35 layout test failures due to minor pixel differences which I rebaselined on Windows and Linux, and 8 genuine failures related to masks and stroked text, which I have put in text_expectations.txt and assigned to myself. (There was another change which broke ~1700 tests on each platform, but I put that change behind an #ifdef for now). R=brettw Review URL: http://codereview.chromium.org/65012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15949 0039d316-1c4b-4281-b951-d872f2087c98
* Remove executable bit from a bunch of files that shouldn't have it.evan@chromium.org2009-05-118-0/+0
| | | | | | | | | | (No code change.) git ls-tree -r HEAD | grep '^100755' | cut -f2 | egrep '\.(png|txt|mm|cc|h|checksum|asm|js|html|c|css|xml|grd|json)$' | xargs chmod a-x git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15809 0039d316-1c4b-4281-b951-d872f2087c98
* More linux ifdef tweaks. This reverts my earlier change (13503).sky@chromium.org2009-04-272-7/+7
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/100046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14628 0039d316-1c4b-4281-b951-d872f2087c98
* Change Size::IsEmpty() to be consistent with Rect::IsEmpty()erikkay@google.com2009-04-265-23/+46
| | | | | | | | | | | Change Size to not accept negative dimensions to be consistent with Rect. BUG=10992 TEST=base_unittests.exe --gtest_filter=RectTest.IsEmpty Review URL: http://codereview.chromium.org/93131 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14567 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: unit tests fix.agl@chromium.org2009-04-241-0/+4
| | | | | | | | The unit tests will try and create a RenderViewHost with a NULL widget. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14406 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: use opaque NativeViewIdsagl@chromium.org2009-04-244-10/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently we are still passing GtkWidget* into the renderer and trusting the value on the way out. With this patch we switch to using opaque values. These opaque values are handled by a GtkNativeViewIdManger, a singleton object which maintains the list of currently valid ids and their current X window ids. We don't pass the X window ids directly to the renderer because they are a) guessable and b) possibly variable for a GtkWidget. From a patch size point of view, the X window isn't current created at the point where we need it so significant work would be needed to reorder operations to fix that as well. This patch also removes the GTK accesses from the BACKGROUND_X11 thread which were a temporary hack. http://codereview.chromium.org/92110 BUG=9014,9869,10787 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14405 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a leak when we fail to load a gdkpixbuf. I meant to do this intc@google.com2009-04-211-0/+24
| | | | | | | | | the last change, but forgot. Review URL: http://codereview.chromium.org/69042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14143 0039d316-1c4b-4281-b951-d872f2087c98
* Eliminate a circular dependency by making BGRAToRGBA() generic (no pulling ↵sgk@google.com2009-04-212-25/+0
| | | | | | | | in guchar from gtk.h) and moving it from base/gfx to base. Review URL: http://codereview.chromium.org/87016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14117 0039d316-1c4b-4281-b951-d872f2087c98
* Hide the Fullscreen exit bubble if the mouse goes idle. It took a ↵pkasting@chromium.org2009-04-202-0/+7
| | | | | | | | | | | depressing amount of time for me to think my way through this algorithm :( Along the way I added an operator=() to convert from POINT to gfx::Point() since doing explicit temp conversion for a case like this annoys me. BUG=10568 Review URL: http://codereview.chromium.org/67265 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14031 0039d316-1c4b-4281-b951-d872f2087c98
* Add missing include needed for malloc.thestig@chromium.org2009-04-161-0/+1
| | | | | | | | Patch by Craig Schlenter <craig.schlenter@gmail.com> Review URL: http://codereview.chromium.org/67228 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13864 0039d316-1c4b-4281-b951-d872f2087c98
* Recommit previous change with GYP files fixed.erg@google.com2009-04-162-68/+0
| | | | | | | | | | | | | Implement BookmarkContextMenuGtk and hook it up to most bookmark bar elements. Also: - Fixes window dispositions (shift-click works on bookmark bar items). - Reorganizes gtk_utils Original Review URL: http://codereview.chromium.org/76002 Review URL: http://codereview.chromium.org/67223 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13857 0039d316-1c4b-4281-b951-d872f2087c98
* Have ResourceBundle own GdkPixbufs.tc@google.com2009-04-161-2/+0
| | | | | | | | | | | | | | | | | This is the same as how ResourceBundle owns the SkBitmaps it loads. This should be faster than before because ResourceBundle will only load each bitmap once and cache the image. Also fix a memory leak in GdkPixbufFromSkBitmap. valgrind says we're not leaking here. BUG=9988 Review URL: http://codereview.chromium.org/67179 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13847 0039d316-1c4b-4281-b951-d872f2087c98
* Reverts the previous two commits. (r13812 and r13811).erg@google.com2009-04-152-0/+70
| | | | | | Review URL: http://codereview.chromium.org/75023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13813 0039d316-1c4b-4281-b951-d872f2087c98
* Implement BookmarkContextMenuGtk and hook it up to most bookmark bar elements.erg@google.com2009-04-152-70/+0
| | | | | | | | | | Also: - Fixes window dispositions (shift-click works on bookmark bar items). - Reorganizes gtk_utils Review URL: http://codereview.chromium.org/76002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13811 0039d316-1c4b-4281-b951-d872f2087c98