Commit Graph

2085 Commits

Author SHA1 Message Date
reed
c3b3266b7d hide SkBitmap::Config entirely (behind a flag)
patch from issue 339463002

TBR=

I think the NoGPU failure is unrelated, so ignoring
NOTRY=True

Author: reed@google.com

Review URL: https://codereview.chromium.org/340533002
2014-06-17 08:38:31 -07:00
mtklein
a272d6d065 Move SkStringUtils.h to src/core.
Doesn't need to be in include/.

BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/335413004
2014-06-17 07:42:35 -07:00
fmalita
07fc662d7e Prepare for internal SaveFlags removal.
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-16 12:13:39 -07:00
reed
885f2ea46e fix legacy code path for SK_SUPPORT_LEGACY_IMAGEDECODER_CONFIG
BUG=skia:
R=scroggo@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/332223002
2014-06-16 08:25:57 -07:00
reed
f252f64f17 hide virtuals on device for width/height/isopaque
R=bsalomon@google.com
NOTREECHECKS=True

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/334993002
2014-06-14 04:24:57 -07:00
reed
bfefc7c95f hide Config in SkImageDecoder -- use SkColorType instead
patch from issue 334613003

TBR=scroggo

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/334793002
2014-06-12 17:40:00 -07:00
robertphillips
02830f0448 Remove SkPicture SK_SUPPORT_LEGACY_RECORDING_FLAG flag
Chromium/Blink should no longer need this flag after:

Chromium: Remove use of kUsePathBoundsForClip_RecordingFlag https://codereview.chromium.org/322123002/

Blink: Remove use of kUsePathBoundsForClip_RecordingFlag https://codereview.chromium.org/326953002/

R=mtklein@google.com, scroggo@google.com, reed@google.com, bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/328343002
2014-06-12 12:56:58 -07:00
egdaniel
e61c411c12 Use vertex attributes for dash effect in gpu
This will allow us to batch dashed lines together when drawing. Also, this removes the need for
a coord transform matrix in the shader, thus we save the cost of uploading a new matrix uniform
everytime we do a simple transform to the dashed line we are drawing.

BUG=skia:
R=bsalomon@google.com

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/326103002
2014-06-12 10:24:21 -07:00
reed
2f785a24eb remove GetDeviceConfig/SetDeviceConfig
BUG=skia:
R=scroggo@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/332453002
2014-06-12 09:21:31 -07:00
robertphillips
e26e65e8f8 Remove SkPicture pointer from SkPicturePlayback
This CL simplifies the relationship between SkPicture and SkPicturePlayback by moving the path heap into SkPicturePlayback and removing SkPicturePlayback's SkPicture pointer.

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

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/334493002
2014-06-12 05:51:22 -07:00
robertphillips
0bdbea75ff Remove picture pre-allocation from SkPictureRecorder
This CL improves the separation of the SkPicture and SkPictureRecord classes. It delays creation of the SkPicture (in SkPictureRecorder) until recording is actually completed. To accomplish this the SkRecord-derived classes now get SkPathHeap and SkPictureContentInfo members that are absorbed by the SkPicture when it is constructed.

As an ancillary change, this CL also moves the SkPictureContentInfo object from SkPicture to SkPicturePlayback. This is intended to centralize all the data in the SkPicturePlayback object.

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

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/324293004
2014-06-11 11:37:55 -07:00
reed
5926b86b90 hide SkImageDecoder::Chooser
BUG=skia:
R=scroggo@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/331433003
2014-06-11 10:33:13 -07:00
reed
4585144956 remove SK_SUPPORT_LEGACY_DEVICE_CONFIG code
BUG=skia:
R=djsollen@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/327263002
2014-06-11 07:17:11 -07:00
reed
e4538f5b46 switch to colortype for deepcopy
BUG=skia:
R=robertphillips@google.com, bsalomon@google.com, reed@google.com

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/323283002
2014-06-11 06:09:50 -07:00
dandov
9de5b514d3 SkShader::asNewEffect Refactoring
The new signature is:

	bool asNewEffect(GrContext* context, const SkPaint& paint, GrColor* grColor, GrEffectRef** grEffect, const SkMatrix* localMatrixOrNull) const;

It will fix the hack for skcolorshader by modifying the GrColor parameter in SkGr::SkPaint2GrPaintShader.

BUG=skia:2646
R=jvanverth@google.com, bsalomon@google.com

Author: dandov@google.com

Review URL: https://codereview.chromium.org/318923005
2014-06-10 14:38:28 -07:00
robertphillips
6de27127c4 Remove unused 'deepCopy' parameter
This is split out of https://codereview.chromium.org/316063005/ for clarity. Keeping in mind that SkPicture::FakeEndRecording is now only called from SkPictureRecorder, its deepCopy parameter is no longer necessary. This is b.c., given the new Picture recording semantics (where SkPictures can no longer be actively recording), cloning for thread safety only happens when an SkPicturePlayback has already been allocated (i.e., it happens in the SkPicturePlayback copy constructor.

R=scroggo@google.com, reed@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/324093003
2014-06-10 09:23:06 -07:00
robertphillips
074fe9df94 Remove legacy drawPicture entry point
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-10 07:20:48 -07:00
jvanverth
2d2a68c51b Gamma correction for distance field text.
Handles both non-LCD and LCD text. Uses a texture to look up the gamma correction values for a given text color or luminance.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/4d517fdbb145cb95e5e935470df331e1b6667cfc

R=reed@google.com, bungeman@google.com, robertphillips@google.com, bsalomon@google.com

Author: jvanverth@google.com

Review URL: https://codereview.chromium.org/258883002
2014-06-10 06:42:56 -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
mtklein
b83f6c3cbd Add assertHeld() to SkMutex.
BUG=skia:
R=bungeman@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/313823004
2014-06-09 14:18:03 -07:00
scroggo
919ed4c736 Revert of Gamma correction for distance field text. (https://codereview.chromium.org/258883002/)
Reason for revert:
Memory leaks. I suspect this is due to the lack of destructors in SkAutoGlyphCache

Original issue's description:
> Gamma correction for distance field text.
>
> Handles both non-LCD and LCD text. Uses a texture to look up the gamma correction values for a given text color or luminance.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4d517fdbb145cb95e5e935470df331e1b6667cfc

NOTRY=true
NOTREECHECKS=true
R=reed@google.com, bungeman@google.com, robertphillips@google.com, bsalomon@google.com, jvanverth@google.com, mtklein@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/323513005
2014-06-09 13:06:34 -07:00
jvanverth
4d517fdbb1 Gamma correction for distance field text.
Handles both non-LCD and LCD text. Uses a texture to look up the gamma correction values for a given text color or luminance.

BUG=skia:
R=reed@google.com, bungeman@google.com, robertphillips@google.com, bsalomon@google.com

Author: jvanverth@google.com

Review URL: https://codereview.chromium.org/258883002
2014-06-09 12:04:55 -07:00
bsalomon
b6b0252643 Add dump() to SkClipStack to help with debugging.
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/311263015
2014-06-09 07:59:06 -07:00
robertphillips
9f1c241e0d Remove SkPicture::kUsePathBoundsForClip_RecordingFlag
The real question is whether we ever want to record a picture without using the path bounds for a conservative (but faster) clip answer?

R=reed@google.com, mtklein@google.com, djsollen@google.com, scroggo@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/316143003
2014-06-09 06:25:34 -07:00
robertphillips
e2f2b98444 No longer limit SkPictureRecorder::partialReplay to Android
Toggling this for local testing is a bit of a chore.

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

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/316173004
2014-06-08 13:12:44 -07:00
robertphillips
643b8bd661 First pass at splitting out SkPictureRecord from SkPicture
This patch begins the process of splitting apart SkPicture, SkPicturePlayback and SkPictureRecord.

This is still a bit messy. In a follow up CL I hope to delay the creation of SkPictureRecorder's SkPicture until endRecording time.

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

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/318763004
2014-06-08 05:55:05 -07:00
Mike Klein
b77c7ef37f Clean up Skia for Clang's -Wtautological-undefined-compare
This is blocking Chrome from rolling a new Clang, and me too for our TSAN bots.

BUG=chromium:381910

Review URL: https://codereview.chromium.org/325603002
2014-06-07 19:15:14 -04:00
sugoi
0951fe1298 Fixing another clusterfuzz issue
This was introduced by removing SkValidatingReadBuffer::readBitmap in https://codereview.chromium.org/295793002/

Since SkReadBuffer::skip wasn't virtual, it was using the unsafe SkReadBuffer::skip within SkReadBuffer::readBitmap rather than using SkValidatingReadBuffer::skip. I also removed direct uses of fReader within SkReadBuffer::readBitmap so that it can use the virtual readInt / readFixed functions that have a version in SkValidatingReadBuffer.

Also, I changed SkReadBuffer::readPoint so that it uses the virtual readScalar, that way, it becomes redundant with SkValidatingReadBuffer::readPoint, which can then be removed.

BUG=380723
R=reed@google.com, mtklein@google.com, sugoi@google.com

Author: sugoi@chromium.org

Review URL: https://codereview.chromium.org/317003003
2014-06-06 06:44:17 -07:00
mtklein
a8928b745a Add SkBarriers_tsan.h.
Slight counterproposal to crrev.com/310663002.

BUG=skia:

No API changes.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/306373002
2014-06-06 06:21:49 -07:00
krajcevski
c250d2e4ab Initial KTX encoder
The encoder comes with tests to check that the encoding/decoding
operations between ETC encoded bitmaps and ARGB bitmaps are sane.

R=bsalomon@google.com, robertphillips@google.com

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/312353003
2014-06-06 06:16:28 -07:00
fmalita
c3b589a24e SkClipStack::Element tweaks.
(
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-05 12:40:07 -07:00
reed
ddd014e652 remove SkBitmap::allocConfigPixels and update dox
I see no callers in android

R=scroggo@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/310283004
2014-06-05 08:51:20 -07:00
scroggo
58edea8962 Use the correct homophone of 'there'.
R=reed@google.com
TBR=reed@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/319493004
2014-06-05 07:49:04 -07:00
robertphillips
9b14f26d0f Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer)
R=reed@google.com, bsalomon@google.com, mtklein@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/313613004
2014-06-04 05:40:44 -07:00
krajcevski
99ffe24200 Initial KTX file decoder
R=bsalomon@google.com, robertphillips@google.com, halcanary@google.com, reed@google.com

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/302333002
2014-06-03 13:04:35 -07:00
mtklein
3a2682a77f SK_CPU_ARM --> SK_CPU_ARM32
That's what it means.  It keeps confusing us as named today.

BUG=skia:
R=djsollen@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/314643004
2014-06-03 12:07:31 -07:00
reed
868074b50b remove SkBounder -- unused and unloved
BUG=skia:
R=scroggo@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/312553006
2014-06-03 10:54:00 -07:00
robertphillips
dcf9ab14a1 Remove legacy picture recording
This is unblocked now that Android no longer uses the old interface.

This is just the first step in cleaning this up. Future CLs will constify SkPicture access in SkCanvas and split up the SkPicture/SkPicturePlayback/SkPictureRecord trio.

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

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/313613002
2014-06-03 10:04:47 -07:00
reed
5c404c5577 add makeOffset and makeInset to SkRect
TBR=bsalomon

precursor for https://codereview.chromium.org/306013010

Author: reed@google.com

Review URL: https://codereview.chromium.org/306893012
2014-06-02 14:38:32 -07:00
reed
c77392ed58 use colortype instead of config
clone of https://codereview.chromium.org/305133006/

TBR=

BUG=skia:

Author: reed@google.com

Review URL: https://codereview.chromium.org/301233011
2014-06-02 13:07:26 -07:00
mtklein
1b81877880 Clean up SkOnce:
1 Remove atExit feature: clients can do it just as well as SkOnce can.
  2 Remove support for functors: no one but the unit test did that.
  3 Remove support for unused non-static SkOnceFlag (no SK_ONCE_INIT).
  4 Add SkOnce variants for no-arg functions so we're not forced to pass dummy values all the time.
  5 Merge SkSpinlock and SkOnceFlag, making all members private.
  6 More notes about memory barriers, adding an acquire load after acquiring the spinlock.

BUG=skia:
R=bungeman@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/302083003
2014-06-02 11:26:59 -07:00
robertphillips
d537341e16 Move GrIPoint16 to SkIPoint16 (and remove GrPoint.h)
R=bsalomon@google.com, reed@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/309683002
2014-06-02 10:20:15 -07:00
mtklein
78358bf624 Port most uses of SkOnce to SkLazyPtr.
BUG=skia:

Committed: http://code.google.com/p/skia/source/detail?r=15006

Committed: http://code.google.com/p/skia/source/detail?r=15014

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/304383005
2014-06-02 08:44:27 -07:00
reed
a6a8f00a39 hide SkDevice::config()
TBR=robertphilips

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/302253002
2014-06-02 05:45:32 -07:00
commit-bot@chromium.org
f71e8fd0c5 Revert of Port most uses of SkOnce to SkLazyPtr. (https://codereview.chromium.org/304383005/)
Reason for revert:
linux x86-64 release segfault in src/ports/SkFontHost_fontconfig.cpp:107

http://108.170.220.120:10117/builders/Test-Ubuntu12-ShuttleA-GTX660-x86_64-Release/builds/905/steps/RunTests/logs/stdio

Original issue's description:
> Port most uses of SkOnce to SkLazyPtr.
>
> BUG=skia:
>
> Committed: http://code.google.com/p/skia/source/detail?r=15006
>
> Committed: http://code.google.com/p/skia/source/detail?r=15014

R=reed@google.com, mtklein@chromium.org
TBR=mtklein@chromium.org, reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: mtklein@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@15015 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-31 00:15:22 +00:00
commit-bot@chromium.org
56f7cca144 Port most uses of SkOnce to SkLazyPtr.
BUG=skia:

Committed: http://code.google.com/p/skia/source/detail?r=15006

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

Author: mtklein@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@15014 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-30 23:59:12 +00:00
commit-bot@chromium.org
a1ff26a64a Add a way for the gpu veto to report back the reason why it said no
BUG=2334
R=bsalomon@google.com

Author: humper@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@15012 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-30 21:52:52 +00:00
commit-bot@chromium.org
92a8916540 fix casting issue with or operator
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-30 21:07:05 +00:00
commit-bot@chromium.org
f6351a0718 Revert of Port most uses of SkOnce to SkLazyPtr. (https://codereview.chromium.org/304383005/)
Reason for revert:
Leaking refs on SkTypeface on Macs.

Original issue's description:
> Port most uses of SkOnce to SkLazyPtr.
>
> BUG=skia:
>
> Committed: http://code.google.com/p/skia/source/detail?r=15006

R=reed@google.com, mtklein@chromium.org
TBR=mtklein@chromium.org, reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: mtklein@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@15009 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-30 21:00:52 +00:00
commit-bot@chromium.org
5a70945ddd Port most uses of SkOnce to SkLazyPtr.
BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@15006 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-30 20:42:00 +00:00