Commit Graph

27 Commits

Author SHA1 Message Date
Cary Clark
2a475eae62 add drawString helper to canvas
Many tests and examples use drawText with
a guess of how long the text is in bytes,
or a call to strlen(). Add a helper to
SkCanvas to simplify these examples.

Add another helper for SkString.

R=reed@google.com

Change-Id: I0204a31e938f065606f08ee7cd9a6b36db791ee2
Reviewed-on: https://skia-review.googlesource.com/13642
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-04-28 20:41:04 +00:00
robertphillips
bfe11fc9a6 Update DisplacementMapEffect to sk_sp
TBR=reed@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1877783003

Committed: https://skia.googlesource.com/skia/+/a53011ef44705a091a8e24f7ea289a3f9ad759f2

Review URL: https://codereview.chromium.org/1877783003
2016-04-15 07:17:36 -07:00
robertphillips
47db5fe443 Revert of Update DisplacementMapEffect to sk_sp (patchset #3 id:40001 of https://codereview.chromium.org/1877783003/ )
Reason for revert:
unexpected image diffs in imagefilterscropexpand GM

Original issue's description:
> Update DisplacementMapEffect to sk_sp
>
> TBR=reed@google.com
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1877783003
>
> Committed: https://skia.googlesource.com/skia/+/a53011ef44705a091a8e24f7ea289a3f9ad759f2

TBR=fmalita@chromium.org,reed@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1884253004
2016-04-15 05:09:32 -07:00
robertphillips
a53011ef44 Update DisplacementMapEffect to sk_sp
TBR=reed@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1877783003

Review URL: https://codereview.chromium.org/1877783003
2016-04-15 04:37:07 -07:00
robertphillips
549c899195 Update SkImageSource to sk_sp
TBR=reed@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842243002

Review URL: https://codereview.chromium.org/1842243002
2016-04-01 09:28:51 -07:00
reed
e8f3062a36 switch surface to sk_sp
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1817383002
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot

Review URL: https://codereview.chromium.org/1817383002
2016-03-23 18:59:25 -07:00
reed
9ce9d6772d update callsites for Make image factories
not forced yet, as we still have the build-guard. waiting on chrome CL

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1810813003

TBR=

Review URL: https://codereview.chromium.org/1810813003
2016-03-17 10:51:11 -07:00
mtklein
a1ebeb25e9 Remove const from const int loops.
This drives me nuts, and prevents `while (loops --> 0)`.

BUG=skia:

Review URL: https://codereview.chromium.org/1379923005
2015-10-01 09:43:39 -07:00
joshualitt
8a6697af95 Fix for nexus 5 crashing in GL benches
GLBenches do not expect gl state  to change between onPerCanvasPreDraw and *PostDraw, but we do a clear and sometimes we clear as draw.  This causes us to bind vertex objects / programs / etc.

This change creates two new virtual methods which are called right before and immediately after timing.

BUG=skia:

Review URL: https://codereview.chromium.org/1379853003
2015-09-30 12:11:07 -07:00
fmalita
5598b63cd2 Convert unit tests, GMs from SkBitmapSource to SkImagesource
This removes SkBitmapSource clients within Skia.

http://crrev.com/1334173004 does the same for Blink, so we should be
able to remove SkBitmapSource in a follow-up.

R=reed@google.com,robertphillips@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/1343123002
2015-09-15 11:26:14 -07:00
mtklein
36352bf5e3 C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}
NOPRESUBMIT=true

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1037793002

Review URL: https://codereview.chromium.org/1037793002
2015-03-25 18:17:32 -07:00
mtklein
72c9faab45 Fix up all the easy virtual ... SK_OVERRIDE cases.
This fixes every case where virtual and SK_OVERRIDE were on the same line,
which should be the bulk of cases.  We'll have to manually clean up the rest
over time unless I level up in regexes.

for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end

BUG=skia:

Review URL: https://codereview.chromium.org/806653007
2015-01-09 10:06:40 -08:00
reed
8c0c7b0bcd remove unnecessary bitmapdevice references
TBR=

Author: reed@google.com

Review URL: https://codereview.chromium.org/354143004
2014-06-27 05:49:54 -07:00
tfarina
f168b86d7f Remove Sk prefix from some bench classes.
This idea came while commenting on
https://codereview.chromium.org/343583005/

Since SkBenchmark, SkBenchLogger and SkGMBench are not part of the Skia library,
they should not have the Sk prefix.

BUG=None
TEST=make all
R=mtklein@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/347823004
2014-06-19 12:32:29 -07:00
reed
6c22573edb hide SkBitmap::setConfig
patch from issue 325733002

TBR=scroggo

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/322963002
2014-06-09 19:52:07 -07:00
commit-bot@chromium.org
cac5fd597f Factory methods for heap-allocated SkImageFilter objects.
This is part of an effort to ensure that all SkPaint effects can only be
allocated on the heap.

This patch makes the constructors of SkImageFilter and its subclasses non-public
and instead provides factory methods for creating these objects on the heap. We
temporarily keep constructor of publicly visible classes public behind a flag.

BUG=skia:2187
R=scroggo@google.com, mtklein@chromium.org, reed@google.com, senorblanco@google.com, senorblanco@chromium.org, bsalomon@google.com, sugoi@chromium.org, zork@chromium.org

Author: dominikg@chromium.org

Review URL: https://codereview.chromium.org/182983003

git-svn-id: http://skia.googlecode.com/svn/trunk@13718 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-10 10:51:58 +00:00
commit-bot@chromium.org
3361471a35 Simplify benchmark internal API.
I'm not quite sure why I wrote such a convoluted API with setLoops()/getLoops().
This replaces it with a loops argument passed to onDraw().

This CL is largely mechanical translation from the old API to the new one.
MathBench used this->getLoops() outside onDraw(), which seems incorrect.  I
fixed it.

BUG=
R=djsollen@google.com

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/99893003

git-svn-id: http://skia.googlecode.com/svn/trunk@12466 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-12-03 18:17:16 +00:00
skia.committer@gmail.com
70402c3168 Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@11992 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-29 07:01:50 +00:00
robertphillips@google.com
26e30c5223 Cleanup displacement bench
https://codereview.chromium.org/47553005/



git-svn-id: http://skia.googlecode.com/svn/trunk@11982 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-28 18:07:44 +00:00
mtklein@google.com
410e6e80f0 Refactoring: get rid of the SkBenchmark void* parameter.
While I was doing massive sed-ing, I also converted every bench to use DEF_BENCH instead of registering the ugly manual way.

BUG=
R=scroggo@google.com

Review URL: https://codereview.chromium.org/23876006

git-svn-id: http://skia.googlecode.com/svn/trunk@11263 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-09-13 19:52:27 +00:00
mtklein@google.com
c289743864 Major bench refactoring.
- Use FLAGS_.
   - Remove outer repeat loop.
   - Tune inner loop automatically.

BUG=skia:1590
R=epoger@google.com, scroggo@google.com

Review URL: https://codereview.chromium.org/23478013

git-svn-id: http://skia.googlecode.com/svn/trunk@11187 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-09-10 19:23:38 +00:00
robertphillips@google.com
1f2f338e23 Split SkDevice into SkBaseDevice and SkBitmapDevice
https://codereview.chromium.org/22978012/



git-svn-id: http://skia.googlecode.com/svn/trunk@10995 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-29 11:54:56 +00:00
robertphillips@google.com
9b051a375b Revert r10830 (Split SkDevice out of SkRasterDevice) until we can get Chromium ready.
git-svn-id: http://skia.googlecode.com/svn/trunk@10835 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-20 20:06:40 +00:00
robertphillips@google.com
3055b70018 Split SkDevice out of SkBitmapDevice
https://codereview.chromium.org/22978012/



git-svn-id: http://skia.googlecode.com/svn/trunk@10830 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-20 17:49:04 +00:00
skia.committer@gmail.com
6238c57c8d Sanitizing source files in Skia_Periodic_House_Keeping
git-svn-id: http://skia.googlecode.com/svn/trunk@8833 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-24 07:01:07 +00:00
sugoi@google.com
ca425d9fd9 Build fix
git-svn-id: http://skia.googlecode.com/svn/trunk@8826 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-23 14:37:38 +00:00
sugoi@google.com
580a17241c Added a few bench for some image filters
Review URL: https://codereview.chromium.org/14234019

git-svn-id: http://skia.googlecode.com/svn/trunk@8824 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-23 14:20:45 +00:00