summaryrefslogtreecommitdiffstats
path: root/skia/ext/platform_canvas.cc
Commit message (Collapse)AuthorAgeFilesLines
* Introduce PlatformBitmap, which is a minimal helper class that wraps an SkBitmapreed@google.com2012-10-101-0/+2
| | | | | | | | | | | | | | | | | and a PlatformSurface. This is used to replace the PlatformCanvas that was being passed to BackingStore to return pixels. The problem to solve is that PlatformCanvas is an extension of SkCanvas, and SkCanvas is losing the ability to have its backend specified after its constructor (for performance reasons). The BackingStore interface only needs to return a copy of its pixels, and offer a platform-specific way to draw into it (i.e. BitBlt). The PlatformSurface is sufficient for this, so the larger infrastructure of PlatformCanvas/PlatformDevice is not required. Review URL: https://codereview.chromium.org/11031055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161163 0039d316-1c4b-4281-b951-d872f2087c98
* setBitmapDevice is going away from Skia (and has no callers in Skia or Chrome)reed@google.com2012-10-011-5/+0
| | | | | | | so remove it from platform_canvas. Review URL: https://codereview.chromium.org/10982097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159474 0039d316-1c4b-4281-b951-d872f2087c98
* skia: Rename PlatformDevice::IsNativeFontRenderingAllowed to ↵reveman@chromium.org2012-09-181-3/+1
| | | | | | | | | | | | | | | PlatformDevice::SupportsPlatformPaint. This function is used by PlatformCanvas::SupportsPlatformPaint and there's no benefit in using a different name for this functionality in the PlatformDevice class. BUG=123392 TEST=pass all existing tests Review URL: https://chromiumcodereview.appspot.com/10910317 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157312 0039d316-1c4b-4281-b951-d872f2087c98
* use getTopLayer(now with updatematrixclip) instead of (should be private) ↵reed@google.com2012-03-201-2/+1
| | | | | | | | LayerIter Review URL: https://chromiumcodereview.appspot.com/9753008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127753 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 125473 - skia: Change MakeOpaque() function to take a gfx::Rect ↵akalin@chromium.org2012-03-071-6/+7
| | | | | | | | | | | | | | | parameter. BUG=100898 R=pkasting@chromium.org TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/9581040 TBR=tfarina@chromium.org Review URL: https://chromiumcodereview.appspot.com/9621019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125478 0039d316-1c4b-4281-b951-d872f2087c98
* skia: Change MakeOpaque() function to take a gfx::Rect parameter.tfarina@chromium.org2012-03-071-7/+6
| | | | | | | | | | BUG=100898 R=pkasting@chromium.org TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/9581040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125473 0039d316-1c4b-4281-b951-d872f2087c98
* implement MakeOpaque at the canvas level, respecting matrix and clipreed@google.com2011-08-311-3/+16
| | | | | | Review URL: http://codereview.chromium.org/7799023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99009 0039d316-1c4b-4281-b951-d872f2087c98
* Fix crash when allocation of very large HTML canvas fails.junov@chromium.org2011-08-191-0/+9
| | | | | | | | | | | | | | This change introduces skia::TryCreateBitmapCanvas, which is a non-crashing version of CreateBitmapCanvas. This patch alone does not fix that crash. A patch in WebKit will be necessary to make the ImageBuffer constructor in ImageBufferSkia.cpp call TryCreateBitmapCanvas. BUG=88038 TEST=http://www.atopon.org/maze/ Review URL: http://codereview.chromium.org/7686006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97474 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 94905 - Remove (now obsolete) IsNativeFontRendering apivandebo@chromium.org2011-08-021-1/+3
| | | | | | | | | | | Review URL: http://codereview.chromium.org/7482045 - The webkit side of this change was reverted. TBR=reed@google.com Review URL: http://codereview.chromium.org/7518042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95108 0039d316-1c4b-4281-b951-d872f2087c98
* Remove (now obsolete) IsNativeFontRendering apireed@google.com2011-08-011-3/+1
| | | | | | Review URL: http://codereview.chromium.org/7482045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94905 0039d316-1c4b-4281-b951-d872f2087c98
* Stop using deprecated factory API for SkDevicereed@google.com2011-07-051-6/+1
| | | | | | | Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=91504 Review URL: http://codereview.chromium.org/7273013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91508 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 91504 - Stop using deprecated factory API for SkDevicereed@google.com2011-07-051-1/+6
| | | | | | | | | Review URL: http://codereview.chromium.org/7273013 TBR=reed@google.com Review URL: http://codereview.chromium.org/7193040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91505 0039d316-1c4b-4281-b951-d872f2087c98
* Stop using deprecated factory API for SkDevicereed@google.com2011-07-051-6/+1
| | | | | | Review URL: http://codereview.chromium.org/7273013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91504 0039d316-1c4b-4281-b951-d872f2087c98
* Remove set of redundant API calls for PlatformDevice instances. These ↵twiz@chromium.org2011-06-161-6/+17
| | | | | | | | | | | | | | | functions were duplicated for both SkCanvas and SkDevice instances. This CL unifies these calls to only make use of the SkCanvas entries. This is CL part of a larger goal to remove the PlatformDevice class. BUG=None TEST=None Review URL: http://codereview.chromium.org/7168022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89410 0039d316-1c4b-4281-b951-d872f2087c98
* This change implements a first pass in the effort to remove the dependency ↵twiz@chromium.org2011-05-261-18/+20
| | | | | | | | | | | | | | of PlatformDevice within Chrome. The Skia library now provides multiple back-ends for the SkDevice class, so PlatformDevice's inheritance of SkDevice, and the assumption of instances of PlatformDevice limits the use of these new back-ends. A new set of helper functions is provided for the PlatformDevice entry points. Upon construction of a PlatformDevice, a pointer to the interface is cached in the parent SkDevice's SkMetaData. The new helper functions forward calls to the interface cached in the metadata. BUG=NONE TEST=NONE Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=86625 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=86625 Review URL: http://codereview.chromium.org/7019013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86823 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 86625 - This change implements a first pass in the effort to remove ↵vandebo@chromium.org2011-05-251-20/+18
| | | | | | | | | | | | | | | the dependency of PlatformDevice within Chrome. The Skia library now provides multiple back-ends for the SkDevice class, so PlatformDevice's inheritance of SkDevice, and the assumption of instances of PlatformDevice limits the use of these new back-ends. A new set of helper functions is provided for the PlatformDevice entry points. Upon construction of a PlatformDevice, a pointer to the interface is cached in the parent SkDevice's SkMetaData. The new helper functions forward calls to the interface cached in the metadata. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/7019013 TBR=twiz@chromium.org Review URL: http://codereview.chromium.org/6987019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86629 0039d316-1c4b-4281-b951-d872f2087c98
* This change implements a first pass in the effort to remove the dependency ↵twiz@chromium.org2011-05-251-18/+20
| | | | | | | | | | | | of PlatformDevice within Chrome. The Skia library now provides multiple back-ends for the SkDevice class, so PlatformDevice's inheritance of SkDevice, and the assumption of instances of PlatformDevice limits the use of these new back-ends. A new set of helper functions is provided for the PlatformDevice entry points. Upon construction of a PlatformDevice, a pointer to the interface is cached in the parent SkDevice's SkMetaData. The new helper functions forward calls to the interface cached in the metadata. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/7019013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86625 0039d316-1c4b-4281-b951-d872f2087c98
* Update Chrome's Skia Device to use the new device factory interface ↵vandebo@chromium.org2011-04-291-2/+2
| | | | | | | | | | | | | (http://code.google.com/p/skia/source/detail?r=1180). Remove valgrind suppression. BUG=80836 TEST=NONE Review URL: http://codereview.chromium.org/6883255 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83555 0039d316-1c4b-4281-b951-d872f2087c98
* Eliminate unused function.pkasting@chromium.org2011-04-251-7/+0
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/6898028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82886 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed build failure on linux and mac. PlatformDevice::makeOpaque is only ↵alokp@chromium.org2011-04-131-2/+4
| | | | | | | | | present on windows! TBR=reed@google.com Review URL: http://codereview.chromium.org/6834029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81429 0039d316-1c4b-4281-b951-d872f2087c98
* Added skia::MakeOpaque helper function needed to rid WebKit of ↵alokp@chromium.org2011-04-131-0/+5
| | | | | | | | PlatformCanvas/Device dependency. Review URL: http://codereview.chromium.org/6835025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81428 0039d316-1c4b-4281-b951-d872f2087c98
* Chromium does native painting on a very specific device - a device retrieved ↵alokp@chromium.org2011-04-111-12/+12
| | | | | | | | | through a layer iterator. This device is neither SkCanvas::getDevice() or SkCanvas::getTopDevice(). We changed it to do native painting on SkCanvas::getDevice() in r80955 which resulted in numerous regressions. This patch reverts to using the same device used pre r80955. BUG=78891 Review URL: http://codereview.chromium.org/6826040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81143 0039d316-1c4b-4281-b951-d872f2087c98
* Added skia::SupportsPlatformPaint for webkit to query whether it can use ↵alokp@chromium.org2011-04-111-0/+8
| | | | | | | | native API to draw on a particular canvas. Review URL: http://codereview.chromium.org/6820037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81107 0039d316-1c4b-4281-b951-d872f2087c98
* Eliminate skia::PlatformCanvas, a subclass of SkCanvas. Skia provides ↵alokp@chromium.org2011-04-081-0/+16
| | | | | | | | | | | | | | | | multiple types of SkCanvas classes that we would like to use. Unfortunately these classes are implemented as subclasses of SkCanvas. Subclassing SkCanvas in both Skia and Chromium makes it impossible to dynamically use any SkCanvas. There is also no reason for chromium to subclass SkCanvas. Most of the extra functionalities can be implemented by hanging meta-data from SkCanvas. We cannot eliminate skia::PlatformCanvas in one step due to WebKit's dependency on skia::PlatformCanvas. WebKit::WebCanvas is typedef as skia::PlatformDevice. It should be SkCanvas. So we need to do it in multiple steps: 1. Prepare Chromium tree for the change in WebKit::WebCanvas tyepdef. This basically means adding a couple of static_cast<skia::PlatformCanvas>(WebCanvas). 2. Change WebKit::WebCanvas typedef from skia::PlatformCanvas to SkCanvas 3. Eliminate skia::PlatformCanvas in chromium This CL accomplishes the first step on windows. WebKit BUG=https://bugs.webkit.org/show_bug.cgi?id=57563 Review URL: http://codereview.chromium.org/6783023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80955 0039d316-1c4b-4281-b951-d872f2087c98
* Wire up missing functionality in BitmapPlatformContext to allow the creation ↵brettw@chromium.org2011-01-061-0/+9
| | | | | | | | | | | | | of a skia::PlatformCanvas from a CGContextRef. TEST=test_shell_tests, try (mac,win,linux) Original review=http://codereview.chromium.org/6064007/ Patch by sjl@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70596 0039d316-1c4b-4281-b951-d872f2087c98
* Roll Skia deps to r621.vandebo@chromium.org2010-10-271-1/+1
| | | | | | | | | | | | Move device capabilities from device factories to the device class itself. (Skia r618) Cleanup: remove the Sk prefix from our device factories and inherit from SkDeviceFactory instead of SkRasterDeviceFactory (no real change). BUG=None TEST=None Review URL: http://codereview.chromium.org/4143002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64086 0039d316-1c4b-4281-b951-d872f2087c98
* Update use of SkCanvas and SkDevice to match change in Skia:vandebo@chromium.org2010-10-151-0/+9
| | | | | | | | | | | Refactor SkCanvas so that backends don't need to override it - instead take a device factory class. see: http://codereview.appspot.com/2103045/ BUG=New Skia devices required a corresponding canvas TEST=None Review URL: http://codereview.chromium.org/3590011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62813 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor the PlatformContext layer to have only one class.brettw@chromium.org2009-06-141-0/+26
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