summaryrefslogtreecommitdiffstats
path: root/skia/ext/skia_utils_mac_unittest.mm
Commit message (Collapse)AuthorAgeFilesLines
* Reuse Skia functions for converting to/from NSImage.dcheng@chromium.org2013-11-201-9/+10
| | | | | | | | | | | This also fixes one of the colorspace conversion issues in the Skia Mac utils tests. BUG=79946 Review URL: https://codereview.chromium.org/77823003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236223 0039d316-1c4b-4281-b951-d872f2087c98
* mac: Update clients of scoped_nsobject.h.thakis@chromium.org2013-06-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 1.) The header is now in base/mac instead of base/memory 2.) The class is now in namespace base. This CL was created programmatically by running: 1.) git grep -l memory/scoped_nsobject.h | xargs sed -i -e 's/memory\/scoped_nsobject.h/mac\/scoped_nsobject.h/g' for f in $(git diff --name-only origin); do tools/sort-headers.py $f -f; done git commit -a -m headers # manually undo changes to gypi file git cl upload # patch set 1 2.) git grep -l 'scoped_nsobject<' | xargs sed -i -e 's/scoped_nsobject</base::scoped_nsobject</g' # manually undo comment changes in scoped_nsobject.h, tracking_area.h git commit -a -m format git cl upload # patch set 2 # Manually audit all files, file bugs and clean up bad clang-format decisions git cl upload # patch set 3 BUG=251957 TBR=mark@chromium.org Review URL: https://codereview.chromium.org/17593006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208283 0039d316-1c4b-4281-b951-d872f2087c98
* remove calls to deprecated SkCanvas::setBitmapDevice.reed@google.com2012-10-011-7/+4
| | | | | | | Retry of 159477 but passes test again Review URL: https://codereview.chromium.org/11019014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159485 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 159477 - remove reference to deprecated setBitmapDevicereed@google.com2012-10-011-1/+10
| | | | | | | | | | this unblocks Skia DEPS roll Review URL: https://codereview.chromium.org/11014019 TBR=reed@google.com Review URL: https://codereview.chromium.org/11014023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159481 0039d316-1c4b-4281-b951-d872f2087c98
* remove reference to deprecated setBitmapDevicereed@google.com2012-10-011-10/+1
| | | | | | | this unblocks Skia DEPS roll Review URL: https://codereview.chromium.org/11014019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159477 0039d316-1c4b-4281-b951-d872f2087c98
* Reenables previously failing tests in SkiaUtilsMacTest.*pkotwicz@chromium.org2012-07-271-3/+3
| | | | | | | | | BUG=None TEST=unit tests pass Review URL: https://chromiumcodereview.appspot.com/10828036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148678 0039d316-1c4b-4281-b951-d872f2087c98
* This patch makes ImageSkia more like SkBitmap. The goal is to make swapping ↵pkotwicz@chromium.org2012-05-161-31/+11
| | | | | | | | | | | | | from SkBitmap to ImageSkia easier. Notable changes: - ImageSkia can be cheaply copied - Added extractSubset, will remove after SkBitmaps have been converted to ImageSkia - Modified API to look more like SkBitmap Review URL: https://chromiumcodereview.appspot.com/10245003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137520 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 136332 - This patch makes ImageSkia more like SkBitmap. The goal is ↵pkotwicz@chromium.org2012-05-141-10/+30
| | | | | | | | | | | | | | | | | | to make swapping from SkBitmap to ImageSkia easier. Notable changes: - ImageSkia can be cheaply copied - Added extractSubset, will remove after SkBitmaps have been converted to ImageSkia - Modified API to look more like SkBitmap Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=136304 Review URL: https://chromiumcodereview.appspot.com/10245003 TBR=pkotwicz@chromium.org Review URL: https://chromiumcodereview.appspot.com/10389132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136995 0039d316-1c4b-4281-b951-d872f2087c98
* This patch makes ImageSkia more like SkBitmap. The goal is to make swapping ↵pkotwicz@chromium.org2012-05-101-30/+10
| | | | | | | | | | | | | | | from SkBitmap to ImageSkia easier. Notable changes: - ImageSkia can be cheaply copied - Added extractSubset, will remove after SkBitmaps have been converted to ImageSkia - Modified API to look more like SkBitmap Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=136304 Review URL: https://chromiumcodereview.appspot.com/10245003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136332 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 136304 - This patch makes ImageSkia more like SkBitmap. The goal is ↵pkotwicz@chromium.org2012-05-101-11/+31
| | | | | | | | | | | | | | | | to make swapping from SkBitmap to ImageSkia easier. Notable changes: - ImageSkia can be cheaply copied - Added extractSubset, will remove after SkBitmaps have been converted to ImageSkia - Modified API to look more like SkBitmap Review URL: https://chromiumcodereview.appspot.com/10245003 TBR=pkotwicz@chromium.org Review URL: https://chromiumcodereview.appspot.com/10383110 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136313 0039d316-1c4b-4281-b951-d872f2087c98
* This patch makes ImageSkia more like SkBitmap. The goal is to make swapping ↵pkotwicz@chromium.org2012-05-101-31/+11
| | | | | | | | | | | | | from SkBitmap to ImageSkia easier. Notable changes: - ImageSkia can be cheaply copied - Added extractSubset, will remove after SkBitmaps have been converted to ImageSkia - Modified API to look more like SkBitmap Review URL: https://chromiumcodereview.appspot.com/10245003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136304 0039d316-1c4b-4281-b951-d872f2087c98
* Create a local bitmap to capture CoreGraphics renderingcaryclark@google.com2012-04-111-9/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when the canvas is not backed by a bitmap. During normal desktop drawing, CoreGraphics calls that image theme elements like checkboxes and buttons draw into the device bitmap owned by Skia's canvas. When a PDF is created as part of a print preview, no bitmap is allocated. In the latter case, associate a local array of pixels with the CGContext to capture the theme rendering, then draw it with Skia once the theme rendering is complete. This fix over-allocates memory. It creates a pixel map as large as the device. The bounds of the CG drawing is not visible to Skia, and the clip may not be set. The PDF may be larger than need be for the same reason. In a subsequent change, the theme element's bounds can reduce the size of the bitmap allocation. This could be done by setting the clip or by passing the rectangle to the graphics context. This would require a sizeable edit to RenderThemeMac.mm. Also, change the unit test to test both paths, when the device is backed by a bitmap, and when it is not. This requires the unit test to call the destructor and reset the clip before comparing the results. BUG=121752 TEST=http://stmarksparish.com/printtest.aspx, print to PDF TEST=SkiaUtilsMacTest.BitLocker_* Review URL: https://chromiumcodereview.appspot.com/10031005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131795 0039d316-1c4b-4281-b951-d872f2087c98
* Add utility for converting SkCanvas to CGContextcaryclark@chromium.org2011-05-171-1/+61
| | | | | | | | | | | | | | | | | | | | | | | | | Skia on Mac uses Skia to render WebKit, and CG to render UI elements. The CG elements need a transcribed graphics context that preserves the canvas matrix, and the canvas clip. The BitLockerSkia utility class sets up a CGContext from the SkCanvas, locks the bitmap's bits, and releases the lock when the class goes out of scope. Each time the CGContext is retrieved, it is rebuilt. This permits the caller to modify the same canvas between calls. Outside of the unit test, there are no callers to this utility for now. BUG=79463 TEST=SkiaUtilsMacTest.* Review URL: http://codereview.chromium.org/7031006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85692 0039d316-1c4b-4281-b951-d872f2087c98
* Suppress Skia unit test failures on Mac OS X Leopard.kbr@google.com2011-04-271-3/+3
| | | | | | | | BUG=80740 TBR=sail Review URL: http://codereview.chromium.org/6893079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83257 0039d316-1c4b-4281-b951-d872f2087c98
* Use large icon resource paksail@chromium.org2011-04-271-19/+117
| | | | | | | | | | | | | | | | This is part of change r82185 that was reverted due to a performance regression on 10.5. The performance regression was due to a change in skia_utils_mac.mm to draw images using -[NSImageRep drawRect:] instead of -[NSImage drawRect:...]. It turns out that on 10.5 -[NSImage drawRect:...] does caching that imporoves performance for subsequent drawing by as much as 4x. This change is similar to r82185 expect that we now use -[NSImage drawRect:] if available. BUG=75812 TEST=Ran unit tests locally, try jobs pending. Review URL: http://codereview.chromium.org/6905003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83206 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 82838 - Temporary change to test perf regression (full)This change ↵sail@chromium.org2011-04-251-119/+23
| | | | | | | | | tests which part of this review:http://codereview.chromium.org/6897013/is causing a performance regression. This change will be reverted later tonight. TBR=sail@chromium.org Review URL: http://codereview.chromium.org/6895050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82856 0039d316-1c4b-4281-b951-d872f2087c98
* Temporary change to test perf regression (full)sail@chromium.org2011-04-251-23/+119
| | | | | | | | This change tests which part of this review: http://codereview.chromium.org/6897013/ is causing a performance regression. This change will be reverted later tonight. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82838 0039d316-1c4b-4281-b951-d872f2087c98
* Revert due to NSImageRepToSkBitmap failure on MACamit@chromium.org2011-04-221-119/+23
| | | | | | | | Revert 82688 - Use large icon resource pakThis is a part of r82185 that was reverted. The change was reverted because it caused a performance regression.In r82538 and r82584 I re-checked in code to split high-res icons into a seperate resource pak and load it.This change adds code to actually use use the high-res icons.BUG=NoneTEST=NoneReview URL: http://codereview.chromium.org/6897013 TBR=sail@chromium.org Review URL: http://codereview.chromium.org/6896034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82704 0039d316-1c4b-4281-b951-d872f2087c98
* Use large icon resource paksail@chromium.org2011-04-221-23/+119
| | | | | | | | | | | | | | This is a part of r82185 that was reverted. The change was reverted because it caused a performance regression. In r82538 and r82584 I re-checked in code to split high-res icons into a seperate resource pak and load it. This change adds code to actually use use the high-res icons. BUG=None TEST=None Review URL: http://codereview.chromium.org/6897013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82688 0039d316-1c4b-4281-b951-d872f2087c98
* Revert high res icon changessail@chromium.org2011-04-201-121/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new high res icon change may have caused a perf regression. To verify I'm reverting the following chnages: commit 3a360c6b3d2fc174cb7597d6365cfc5418d1442b r82326 Disable loading high res icons on Mac commit 3c39226937a39d0042b8a794f13505c7a25ca58b r82247 Fix reload button unit test commit f87ab117fc159566868e71e4df5672852bebd718 r82245 Unregister toolbar view from window notifications commit 0b287ba4a4ad5c19d901f973eb9af594dcf3dba1 r82239 Fix failing Mac unit tests commit 8b681c46a139d12151323952c58122f6805d7597 r82236 Mac: Remove custom drawn buttons commit 6ae8a2fe40485731b86267e362936db16b4c0706 r82209 Fix clang build break commit e8a19d1e0c76f204c834318566e4206320583449 r82185 Add support for multi resolution icons BUG=None TEST=Compling Review URL: http://codereview.chromium.org/6878077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82352 0039d316-1c4b-4281-b951-d872f2087c98
* suppress some skia mac failures to green up the botsdpranke@chromium.org2011-04-201-3/+3
| | | | | | | | TBR=sail Review URL: http://codereview.chromium.org/6880061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82233 0039d316-1c4b-4281-b951-d872f2087c98
* Fix clang build breaksail@chromium.org2011-04-201-1/+0
| | | | | | | | | BUG=None TEST=None TBR=thakis Review URL: http://codereview.chromium.org/6882063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82209 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for multi resolution iconssail@chromium.org2011-04-191-23/+122
| | | | | | | | | | | | | | | | | | | | | | | | To support HiDPI we need a way to load two copies of icons, a low resolution version and a high resolution version. To support this, this change does the following: - split theme_resource.grd into three files: - theme_resources.grd: icons that only have one resolution - theme_resources_standard.grd: low resolution icons - theme_resources_large.grd: high resolution icons - theme_resource.grd and theme_resources_standard.grd and compiled into chrome.pak/chrome.rc for all platforms. - theme_resources_large.grd is compiled into theme_resources_large.pak for platforms that want high resolution icons (currently only Mac) - gfx::Image now support icons with multiple resolution Currently not all ThemeService APIs return multi-resolution images. Once this is checked in I'll work on converting them as I go. Note, this change will have to be coordinated with the change to reorganize theme resources. I'll work with saintlou on that. BUG=75812 TEST=Added a TIFF to theme_resources.grd. Verified that the toolbar icon had a mutliresolution image. Verified that unit tests passed. Review URL: http://codereview.chromium.org/6849030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82185 0039d316-1c4b-4281-b951-d872f2087c98
* Mac: Fix color space usage in SkiaUtilsMacTestthakis@chromium.org2010-07-071-7/+13
| | | | | | | | | BUG=47885 TEST=test passes on 10.6 Review URL: http://codereview.chromium.org/2873041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51735 0039d316-1c4b-4281-b951-d872f2087c98
* Add favicons to tabs on the Mac. Also moved SkBitmapToNSImage() toavi@chromium.org2009-06-251-0/+71
| | | | | | | | | | | | | skia/ext/skia_utils_mac.h and removed chrome/browser/cocoa/cocoa_utils.h. Patch by rsesek. BUG=13565 http://codereview.chromium.org/131018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19266 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting r19244 as it unintentionally broke ui tests: ↵avi@chromium.org2009-06-251-71/+0
| | | | | | OtherRedirectsDontForkProcess InEmptyFrame TestLifetimeOfDomAutomationController git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19245 0039d316-1c4b-4281-b951-d872f2087c98
* Add favicons to tabs on the Mac. Also moved SkBitmapToNSImage() toavi@chromium.org2009-06-251-0/+71
| | | | | | | | | | | | | | skia/ext/skia_utils_mac.h and removed chrome/browser/cocoa/cocoa_utils.h. Patch by rsesek. BUG=13565 Review URL: http://codereview.chromium.org/131018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19244 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting r18743.avi@google.com2009-06-181-83/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18755 0039d316-1c4b-4281-b951-d872f2087c98
* Add favicons to tabs on the Mac. Also moved SkBitmapToNSImage() toavi@google.com2009-06-181-0/+83
skia/ext/skia_utils_mac.h and removed chrome/browser/cocoa/cocoa_utils.h. Patch by rsesek. BUG=13565 Review URL: http://codereview.chromium.org/131018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18743 0039d316-1c4b-4281-b951-d872f2087c98