aboutsummaryrefslogtreecommitdiff
path: root/include/core/SkCanvas.h
AgeCommit message (Collapse)Author
2014-08-21Add SkBitmap::readPixels() and reimplement copyTo and SkCanvas::readPixelsreed
This reverts commit 651eaeadeb0b1407f5fe192aeda90db1680fa2b8. TBR= Author: reed@chromium.org Review URL: https://codereview.chromium.org/390693002
2014-06-18Revert of remove guarded code - there are no more callers ↵reed
(https://codereview.chromium.org/343783002/) Reason for revert: webkit still uses getTotalClip -- need to find where they define the guard. ../../skia/ext/skia_utils_mac.mm:400:42: error: no member named 'getTotalClip' in 'SkCanvas' const SkRegion& clipRgn = canvas_->getTotalClip(); ~~~~~~~ ^ Original issue's description: > remove guarded code - there are no more callers > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/c5d5cf9489977aa6fba077d1dc242029fbb4859e R=scroggo@google.com, reed@google.com TBR=reed@google.com, scroggo@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: reed@chromium.org Review URL: https://codereview.chromium.org/342843002
2014-06-18remove guarded code - there are no more callersreed
BUG=skia: R=scroggo@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/343783002
2014-06-17More SaveFlags removal twiddling.fmalita
This is a follow up to https://codereview.chromium.org/338913002/. More tweaks to allow migrating clients to the new API. 1) switch the shim call direction willSave(SaveFlags) -> willSave() (internal users are still using the former, so external overriders of the latter will not be notified otherwise - doh) 2) ensure willSave() stays visible in SkProxyCanvas (Chromium's TimingCanvas attempts to call it explicitly). BUG=skia:2297 R=reed@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/334393008
2014-06-16Prepare for internal SaveFlags removal.fmalita
Chromium has a couple of SkCanvas subclasses which override willSave(). This adds a transitional shim to facilitate converting these to the parameter-less API. BUG=skia:2297 R=reed@google.com, scroggo@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/338913002
2014-06-10Remove legacy drawPicture entry pointrobertphillips
With Skia 5713352a (Chromium should no longer need the legacy SkCanvas::drawPicture interface - https://codereview.chromium.org/317193002/) this code should no longer be needed. R=reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/324703002
2014-06-05SkClipStack::Element tweaks.fmalita
( This is intended to facilitate efficient kMatrix_SaveFlags emulation on restore(): * collect all clip stack elements for the current save count into a side clip stack * canvas.restore(everything) * replay the collected clip ops to restore the initial clip state => we restored the matrix but the clip state is unchanged ) Two main changes: * expose the save count for SkClipStack::Element * expose a replay method for the same (logic relocated from SkCanvas::replayClips) The SkCanvas::ClipVisitor shuffling is to enable forward decl in SkClipStack.h (cannot fwdecl a nested class). R=reed@google.com, robertphillips@google.com TBR=reed@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/269693003
2014-06-04Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer)robertphillips
R=reed@google.com, bsalomon@google.com, mtklein@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/313613004
2014-06-03remove SkBounder -- unused and unlovedreed
BUG=skia: R=scroggo@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/312553006
2014-05-30fix casting issue with or operatorcommit-bot@chromium.org
R=reed@google.com, epoger@google.com TBR=reed@google.com NOTREECHECKS=true NOTRY=true Author: djsollen@google.com Review URL: https://codereview.chromium.org/305253002 git-svn-id: http://skia.googlecode.com/svn/trunk@15011 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-30Add an OR operator overload for SaveFlags to avoid extra static casts.commit-bot@chromium.org
R=reed@google.com Author: djsollen@google.com Review URL: https://codereview.chromium.org/303373003 git-svn-id: http://skia.googlecode.com/svn/trunk@15005 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-30Fix the rendering error of SkDraw::drawVertices in gpu path for solid color.commit-bot@chromium.org
If both textures and vertex-colors are NULL, drawVertices should stroke hairlines with the paint's color. This behavior is a useful debugging mode to visualize the mesh. BUG=skia:2266 R=bsalomon@google.com, reed@google.com Author: yunchao.he@intel.com Review URL: https://codereview.chromium.org/189963004 git-svn-id: http://skia.googlecode.com/svn/trunk@14985 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-19This adds a checkbox to the debugger to allow seeing the effect pathops has ↵commit-bot@chromium.org
on the clip. A new tab shows the C code that the pathops generate. Once in place, this CL found a bug in the pathops code where it was not handling empty clip stack elements correctly. The Cl also has the change to SkCanvas to fix this bug. R=robertphillips@google.com, reed@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/282283002 git-svn-id: http://skia.googlecode.com/svn/trunk@14774 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-14Inline noop willFoo/didFoo into SkCanvas.h.commit-bot@chromium.org
We've got our canvas subclasses all calling back up to these via INHERITED, all noops. That's fine but currently a little sad as they can't be optimized away without link-time optimization, which we and Chrome only do on Windows. We actually make a call for each of these today on non-Windows. So, move the empty implementations into the header so those chaining calls really can be optimized away. BUG=skia: R=reed@google.com, fmalita@google.com, mtklein@google.com, fmalita@chromium.org Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/287593005 git-svn-id: http://skia.googlecode.com/svn/trunk@14722 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-24Deprecate SaveFlags use in the public SkCanvas API.commit-bot@chromium.org
Because we still have internal users for now (to support the deprecated mode), this CL introduces an external-only variant of deprecation. Chromium is no longer using the deprecated methods, but Android may need to suppress SK_ATTR_EXTERNALLY_DEPRECATED warnings. R=reed@google.com, robertphillips@google.com, scroggo@google.com, bungeman@google.com, mtklein@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/246023008 git-svn-id: http://skia.googlecode.com/svn/trunk@14367 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-24Sanitizing source files in Housekeeper-Nightlyskia.committer@gmail.com
git-svn-id: http://skia.googlecode.com/svn/trunk@14346 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-23Make drawText calls non-virtual, to ease SkFont and TextBlob ↵reed@google.com
(https://codereview.chromium.org/243853006/)" associated chrome change (to be committed with DEPS roll) https://codereview.chromium.org/248693002/ This reverts commit bfaceb53f58c9625b5471fcff35b5ca9ca3ae29c. TBR=bsalomon@google.com Review URL: https://codereview.chromium.org/248083002 git-svn-id: http://skia.googlecode.com/svn/trunk@14321 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-22Revert of make drawText calls non-virtual, to ease SkFont and TextBlob ↵commit-bot@chromium.org
(https://codereview.chromium.org/243853006/) Reason for revert: need to test more the code-path where we don't opt into the new virtuals Original issue's description: > make drawText calls non-virtual, to ease SkFont and TextBlob > > BUG=skia: > > Committed: http://code.google.com/p/skia/source/detail?r=14307 R=robertphillips@google.com TBR=robertphillips@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: reed@google.com Review URL: https://codereview.chromium.org/247983003 git-svn-id: http://skia.googlecode.com/svn/trunk@14314 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-22make drawText calls non-virtual, to ease SkFont and TextBlobcommit-bot@chromium.org
BUG=skia: R=robertphillips@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/243853006 git-svn-id: http://skia.googlecode.com/svn/trunk@14307 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-21add optional origin parameter to accessTopLayerPixelscommit-bot@chromium.org
BUG=skia: R=bsalomon@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/244763004 git-svn-id: http://skia.googlecode.com/svn/trunk@14290 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-11remove picture-backed surfacescommit-bot@chromium.org
BUG=skia: R=robertphillips@google.com, mtklein@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/233943002 git-svn-id: http://skia.googlecode.com/svn/trunk@14159 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-11Update bench to be able to preprocess skpscommit-bot@chromium.org
This allows benchmarking of optimization improvements and plumbs in the purging API. The purging is necessary so we don't magically get faster because the saveLayers are always pre-generated. R=jvanverth@google.com, reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/233663002 git-svn-id: http://skia.googlecode.com/svn/trunk@14154 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-28Add discard API to SkCanvas, plumb it to glDiscardFramebuffer()commit-bot@chromium.org
BUG=skia:2349 R=robertphillips@google.com, reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/211683002 git-svn-id: http://skia.googlecode.com/svn/trunk@13976 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-26remove all references to legacy Config8888reed@google.com
BUG=skia: R=bsalomon@google.com Review URL: https://codereview.chromium.org/211043002 git-svn-id: http://skia.googlecode.com/svn/trunk@13952 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-25Consolidate SkCanvas matrix virtuals.commit-bot@chromium.org
Remove didTranslate, didScale, didRotate & didSkew, and rely on didConcat instead. Subclasses can sniff the matrix type if they want to differentiate. (work in progress) R=reed@google.com, robertphillips@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/203203004 git-svn-id: http://skia.googlecode.com/svn/trunk@13940 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-25Revert "Revert of implement readPixels and writePixels natively, w/o using ↵reed@google.com
the (deprecated) (https://codereview.chromium.org/199733016/)" This reverts commit 9a90bd16dc6756395c422adf0f24560d033ed9ea. BUG=skia: R=bsalomon@google.com Review URL: https://codereview.chromium.org/211293002 git-svn-id: http://skia.googlecode.com/svn/trunk@13939 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-25Revert of implement readPixels and writePixels natively, w/o using the ↵commit-bot@chromium.org
(deprecated) (https://codereview.chromium.org/199733016/) Reason for revert: Android bots segfaulting in tests. Original issue's description: > implement readPixels and writePixels natively, w/o using the (deprecated) > SkCanvas::Config8888 enum. > > Revert "Revert "hide Config8888 entirely". Broke a bunch of builds." > > This reverts commit 763277ba157fef0f651004bb98a189e9f1ac730b. > > Needs chrome to remove the READPIXELS guard from skia's .gyp > > Committed: https://code.google.com/p/skia/source/detail?r=13931 R=reed@google.com TBR=reed@google.com NOTREECHECKS=true NOTRY=true Author: mtklein@google.com Review URL: https://codereview.chromium.org/209233004 git-svn-id: http://skia.googlecode.com/svn/trunk@13932 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-25implement readPixels and writePixels natively, w/o using the (deprecated)reed@google.com
SkCanvas::Config8888 enum. Revert "Revert "hide Config8888 entirely". Broke a bunch of builds." This reverts commit 763277ba157fef0f651004bb98a189e9f1ac730b. Needs chrome to remove the READPIXELS guard from skia's .gyp Review URL: https://codereview.chromium.org/199733016 git-svn-id: http://skia.googlecode.com/svn/trunk@13931 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-20Fix cull nesting assertion.commit-bot@chromium.org
Cull rects are in local coordinates and cannot be compared directly. No wonder it was so hard enforcing this in Blink :o This moves the validation logic into SkCanvas, using a device-space cull stack (debug build only). There are still some Blink bugs causing violations, so for now I'd like to keep this as an error message only. R=reed@google.com, robertphillips@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/200923008 git-svn-id: http://skia.googlecode.com/svn/trunk@13885 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-20Revert "hide Config8888 entirely". Broke a bunch of builds.bsalomon@google.com
This reverts commit fa11c49cc11a6c9ebafbf9c59e118917f9b3cc56. Revert "Sanitizing source files in Housekeeper-Nightly" to make the above revert clean. This reverts commit b5787422c8eb2a27a9576777597fd9e06784acdb. TBR=reed@google.com TBR=jcgregorio@google.com Review URL: https://codereview.chromium.org/205963003 git-svn-id: http://skia.googlecode.com/svn/trunk@13872 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-19hide Config8888 entirelycommit-bot@chromium.org
BUG=skia: R=bsalomon@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/203993002 git-svn-id: http://skia.googlecode.com/svn/trunk@13865 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-18Remove SkCanvas matrix ops return value.commit-bot@chromium.org
The internal SkMatrix ops can no longer fail -> we can remove the bool return value. R=bsalomon@google.com, reed@google.com, robertphillips@google.com, scroggo@google.com, fmalita@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/200223008 git-svn-id: http://skia.googlecode.com/svn/trunk@13849 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-17add new readPixels with direct memory parameterscommit-bot@chromium.org
BUG=skia: R=scroggo@google.com, bsalomon@google.com, robertphillips@google.com, fmalita@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/199413013 git-svn-id: http://skia.googlecode.com/svn/trunk@13840 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-17remove SK_SUPPORT_LEGACY_WRITEPIXELSCONFIG -- dead codecommit-bot@chromium.org
BUG=skia: R=halcanary@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/201973003 git-svn-id: http://skia.googlecode.com/svn/trunk@13834 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-17add NewRasterDirect for creating a canvas drawing to pre-allocated pixelscommit-bot@chromium.org
R=reed@google.com TBR=scroggo@google.com Author: reed@chromium.org Review URL: https://codereview.chromium.org/196923004 git-svn-id: http://skia.googlecode.com/svn/trunk@13824 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-16Proposed SkCanvas API for preLoading textures to VRAM v2.0commit-bot@chromium.org
This is an update to (Proposed SkCanvas API for preLoading textures to VRAM - https://codereview.chromium.org/192853002/). It takes into account in-person feedback on the initial proposal. The main feedback was to land this closer to where we will ultimately wind up with the reordered rendering capability (and don't have an SkCanvas entry point (yet)). Committed: http://code.google.com/p/skia/source/detail?r=13810 R=reed@google.com, bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/197123003 git-svn-id: http://skia.googlecode.com/svn/trunk@13822 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-14Revert r13810 (Proposed SkCanvas API for preLoading textures to VRAM v2.0)robertphillips@google.com
git-svn-id: http://skia.googlecode.com/svn/trunk@13811 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-14Proposed SkCanvas API for preLoading textures to VRAM v2.0commit-bot@chromium.org
This is an update to (Proposed SkCanvas API for preLoading textures to VRAM - https://codereview.chromium.org/192853002/). It takes into account in-person feedback on the initial proposal. The main feedback was to land this closer to where we will ultimately wind up with the reordered rendering capability (and don't have an SkCanvas entry point (yet)). R=reed@google.com, bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/197123003 git-svn-id: http://skia.googlecode.com/svn/trunk@13810 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-13De-virtualize SkCanvas matrix ops.commit-bot@chromium.org
This moves the matrix management logic into non-virtual SkCanvas methods, and turns the virtuals into protected notifiers. R=reed@google.com, robertphillips@google.com, bsalomon@google.com BUG=skia:2297 Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/195793012 git-svn-id: http://skia.googlecode.com/svn/trunk@13799 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-12De-virtualize SkCanvas save/restore.commit-bot@chromium.org
This moves the state management logic into non-virtual SkCanvas methods, and turns the virtuals into protected notifiers. R=reed@google.com, robertphillips@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/194713008 git-svn-id: http://skia.googlecode.com/svn/trunk@13776 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-12support direct writing to top layer, and hide getTopLayer()reed@google.com
this should remove many of the chrome callers that today call accessBitmap on the toplayer, so they can read/write those pixels. The ultimate fix will be to support custom allocation of raster layers (via GDI/cairo/mac) so we can remove PlatformDevice subclassing in skia/ext BUG=skia: R=bsalomon@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/197433002 git-svn-id: http://skia.googlecode.com/svn/trunk@13774 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-12Revert of Revert of Revert "De-virtualize SkCanvas save/restore." ↵commit-bot@chromium.org
(https://codereview.chromium.org/196323003/) Reason for revert: Pulling out to rename the virtuals. Original issue's description: > Revert of Revert "De-virtualize SkCanvas save/restore." (https://codereview.chromium.org/194923008/) > > Reason for revert: > Re-landing after roll fix. > > Original issue's description: > > Revert "De-virtualize SkCanvas save/restore." > > > > (To allow a roll fix into the tree). > > > > This reverts commit edf702204be42c945254191f9f9cd6585b3d189b. > > > > R=halcanary@google.com > > > > Committed: https://code.google.com/p/skia/source/detail?r=13748 > > TBR=halcanary@google.com,fmalita@chromium.org > NOTREECHECKS=true > NOTRY=true > > Committed: http://code.google.com/p/skia/source/detail?r=13754 R=halcanary@google.com, fmalita@chromium.org TBR=fmalita@chromium.org, halcanary@google.com NOTREECHECKS=true NOTRY=true Author: fmalita@google.com Review URL: https://codereview.chromium.org/197553002 git-svn-id: http://skia.googlecode.com/svn/trunk@13765 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-11Revert of Revert "De-virtualize SkCanvas save/restore." ↵commit-bot@chromium.org
(https://codereview.chromium.org/194923008/) Reason for revert: Re-landing after roll fix. Original issue's description: > Revert "De-virtualize SkCanvas save/restore." > > (To allow a roll fix into the tree). > > This reverts commit edf702204be42c945254191f9f9cd6585b3d189b. > > R=halcanary@google.com > > Committed: https://code.google.com/p/skia/source/detail?r=13748 R=halcanary@google.com, fmalita@chromium.org TBR=fmalita@chromium.org, halcanary@google.com NOTREECHECKS=true NOTRY=true Author: fmalita@google.com Review URL: https://codereview.chromium.org/196323003 git-svn-id: http://skia.googlecode.com/svn/trunk@13754 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-11Revert "De-virtualize SkCanvas save/restore."fmalita@google.com
(To allow a roll fix into the tree). This reverts commit edf702204be42c945254191f9f9cd6585b3d189b. R=halcanary@google.com Review URL: https://codereview.chromium.org/194923008 git-svn-id: http://skia.googlecode.com/svn/trunk@13748 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-11De-virtualize SkCanvas save/restore.fmalita@google.com
This moves the state management logic into non-virtual SkCanvas methods, and turns the virtuals into protected notifiers. R=robertphillips@google.com, reed@google.com Review URL: https://codereview.chromium.org/194713008 git-svn-id: http://skia.googlecode.com/svn/trunk@13747 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-10flag to make kClipToLayer_SaveFlag the default behaviorreed@google.com
#define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG to get the old behavior The goal is to remove the feature of saveLayer that allows the canvas to draw outside of the top-most layer. R=robertphillips@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/190723004 git-svn-id: http://skia.googlecode.com/svn/trunk@13730 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-08hide getTotalClip, so we can eventually remove it commit-bot@chromium.org
hide getClipType, so we can eventually remove it patch from issue 189443007 TBR=robertphilips@google.com Author: reed@chromium.org Review URL: https://codereview.chromium.org/189883010 git-svn-id: http://skia.googlecode.com/svn/trunk@13715 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-07Add SkCanvas::writePixels that takes info+pixels directlycommit-bot@chromium.org
add corresponding methods to device (w/ diff name to avoid colliding with exising virtuals) BUG=skia: R=bsalomon@google.com, robertphillips@google.com, junov@google.com, junov@chromium.org Author: reed@google.com Review URL: https://codereview.chromium.org/180113010 git-svn-id: http://skia.googlecode.com/svn/trunk@13697 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-06Now that the matching changes have landed in Chromium we can clean up the ↵commit-bot@chromium.org
API on our side. R=reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/187553003 git-svn-id: http://skia.googlecode.com/svn/trunk@13680 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-28add new onClip* methods to SkCanvasrobertphillips@google.com
https://codereview.chromium.org/183453002/ git-svn-id: http://skia.googlecode.com/svn/trunk@13627 2bbb7eff-a529-9590-31e7-b0007b416f81