History log of /frameworks/base/libs/hwui/SkiaCanvas.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f7d98f436cf1351cb479e0abd6af7056553a6fa9 17-Apr-2017 Derek Sollenberger <djsollen@google.com> Remove round rect clipping optimization.

This optimization fails to account for inverse fill.

Test: bit CtsGraphicsTestCases.CanvasTest
Bug: 37417782
Change-Id: I04adfa93542b1bd1f5d905c64bb40e521242e29d
/frameworks/base/libs/hwui/SkiaCanvas.cpp
ca9b703b8862b4b0a9c6134a0b3e0d1a89a9ae64 13-Apr-2017 Matt Sarett <msarett@google.com> Bug fix: use legacy SkCanvas regardless of color space tag

Test: Added unit test. CtsGraphicsModule.

Bug: 32984164

Change-Id: If72e1e31c98e01f97f3a05d763f5d4c71cf88313
/frameworks/base/libs/hwui/SkiaCanvas.cpp
44dc270830758d5b0f5b099e7c0e308bdf027dfb 13-Apr-2017 Matt Sarett <msarett@google.com> Add SkiaCanvas::captureCanvasState()

Test: Verified bug is fixed. Wrote unit test.

Bug: 37268771

Change-Id: I9deb7db353cd2129ad245e7f65419670463bb717
/frameworks/base/libs/hwui/SkiaCanvas.cpp
eb69cbbe22d993a9ba88a1206853c660f8f43628 11-Apr-2017 Derek Sollenberger <djsollen@google.com> Change behavior of setBitmap to cleanly reset the canvas

- identity matrix
- no save stack
- wide-open clip

This reverts commit 4f641d1e4586b027969052cc0ad6b65c1158e72e

Test: bit CtsGraphicsTestCases:.CanvasTest
Bug: 36218535
Change-Id: Id11deb06e37d6df61f1f171d424ab150d812a7a8
/frameworks/base/libs/hwui/SkiaCanvas.cpp
8242656f495847c50c9ceaea92839dce78218a75 05-Apr-2017 Romain Guy <romainguy@google.com> Color management, the missing pieces

Implement missing color management pieces for bitmaps:

- Bitmap.createBitmap(Bitmap src, ...) now creates a bitmap
in the same color space as the source bitmap
- Bitmap.createScaledBitmap() now creates a bitmap in the
same color space as the source bitmap
- Bitmap.createBitmap(..., ColorSpace colorSpace) to create
bitmaps in a specific color space
- Fix copy from A8 to F16
- Copying bitmaps in F16 or with a color space does not work,
it's currently a limitation in Skia

Bug: 36905374
Test: BitmapColorSpaceTest
Change-Id: I0092fe4432511db50daa3a9393389a9db05e0c2a
/frameworks/base/libs/hwui/SkiaCanvas.cpp
ea70d22dc8dc5d61f075edf6d03f86f6a68169cd 29-Mar-2017 Matt Sarett <msarett@google.com> Xform bitmaps to sRGB on SW and PDF canvases

For picture-backed canvases, we will defer the xform
until playback.

Test: Unit tests and cts test.
Bug: 32984164
Change-Id: Ib74663bcb688b74b6ba8792b403b0475126732af
/frameworks/base/libs/hwui/SkiaCanvas.cpp
871cd2dd6074544bd41a84ff38255d81a392546a 17-Mar-2017 Mike Reed <reed@google.com> use SkVertices::Builder in drawBitmapLattice
override new virtual onDrawVerticesObject

Test: CtsGraphicsTestCases

Change-Id: I38e3ee0aa2a1ee9c11474c2c5d648ee5fca20d78
/frameworks/base/libs/hwui/SkiaCanvas.cpp
4f641d1e4586b027969052cc0ad6b65c1158e72e 14-Mar-2017 Tony Mantler <nicoya@google.com> Revert "Change behavior of setBitmap to cleanly reset the canvas - identity matrix - no save stack - wide-open clip"

https://buganizer.corp.google.com/issues/36218535

This reverts commit 269f989fbf198b17994baf9141c4640aeaf34b4e.

Change-Id: Ib2473e4fce90c9abaa39eea2b77082ae26197b80
/frameworks/base/libs/hwui/SkiaCanvas.cpp
269f989fbf198b17994baf9141c4640aeaf34b4e 01-Mar-2017 Mike Reed <reed@google.com> Change behavior of setBitmap to cleanly reset the canvas
- identity matrix
- no save stack
- wide-open clip

Behavior around the new bitmap is the same.

Tests : CtsGraphicsTestCases

Change-Id: Ieaf8c2a1b96262ed33940dd852a86089eb93efdb
/frameworks/base/libs/hwui/SkiaCanvas.cpp
d7f13f84f8aefcad10ccb83aad794f1864623642 09-Mar-2017 Derek Sollenberger <djsollen@google.com> Prematurely optimizing a Path.

If the path had an inverse fill type we were incorrectly
converting ovals and roundRects to their primitive form
without checking to ensure the path was not inverse fill.

This CL removes these optimizations as they happen internally
within Skia.

Bug: 34245907
Test: verified broken app is fixed and that skia has existing tests
Change-Id: I8c1ff6522ae19fc6c21520adc7e9bc2473a8a4ad
/frameworks/base/libs/hwui/SkiaCanvas.cpp
792fb3252f6460acfd82c4e5d7536ca6b787a0e0 03-Mar-2017 Derek Sollenberger <djsollen@google.com> Use SkPaint.nothingToDraw instead of PaintUtils helper.

The PaintUtils helper is now shared between all pipelines and was
missing a quick reject test for drawLoopers which are used in
view.setShadowLayer and supported in the Skia pipelines.

Bug: 35809097
Test: added hwui unit test and verified in DocumentsUI app
Change-Id: I3c4a988f1c42b7f421f78ac3659af1daee910ea2
/frameworks/base/libs/hwui/SkiaCanvas.cpp
95c1a069f24e630946d044f58e95db9e691f2d84 28-Feb-2017 Derek Sollenberger <djsollen@google.com> Revert "deprecate replayClips"

This reverts commit 82d3b17f6dff9372ec531d90b5d9180671e0ee2c.

Bug: 35831173
Change-Id: I467e7204a5e4bcbab1c12d3fcf52e52188830ed5
/frameworks/base/libs/hwui/SkiaCanvas.cpp
82d3b17f6dff9372ec531d90b5d9180671e0ee2c 24-Feb-2017 Mike Reed <reed@google.com> deprecate replayClips

replayClips is deprecated, just get the rgn instead for setBitmap

Test: ran Canvas CTS
Change-Id: Id0f0da6602d1488bb4071885704fa6e3b449ab85
/frameworks/base/libs/hwui/SkiaCanvas.cpp
b8201195dfb2bae05faaf91b9b3d065e2f199929 09-Jan-2017 Derek Sollenberger <djsollen@google.com> Deprecate Canvas save/saveLayer flags.

Test: compile
Bug: 14650725
Change-Id: I6424ac46bae0a7a87c4b7743e81319945dfdd087
/frameworks/base/libs/hwui/SkiaCanvas.cpp
5e4389823191aafff7422561f134dbdb391e0a2d 25-Jan-2017 Mike Reed <reed@google.com> use new clipbounds api

Allows us to remove SK_SUPPORT_LEGACY_GETCLIPBOUNDS flag

Change-Id: I7c6665b4eb67c58fe747c07b8b87d58fe9b10120
/frameworks/base/libs/hwui/SkiaCanvas.cpp
c2d9470aa9d92be3ffb998ecbbff157b94fdee12 13-Jan-2017 Ben Wagner <bungeman@google.com> Remove SkDevice.h includes.

SkDevice.h is being removed from Skia. This removes these already unused
includes which mention this file.

Test: refactoring CL. Existing unit tests still pass.

Change-Id: I8340a5822ad2b75c54fe0dca1303ceab9bbee805
/frameworks/base/libs/hwui/SkiaCanvas.cpp
b29b16e5423fe7deab8ebf3da512c6d2192f19b5 04-Jan-2017 Derek Sollenberger <djsollen@google.com> Remove clipRegion from the public API.

This API is difficult to support for printing and has other negative
effects as it does not respect the current matrix/clip.

Test: compile
Bug: 14650725
Change-Id: I71f9bd687d446c7ce8910d755421aad8e09458db
/frameworks/base/libs/hwui/SkiaCanvas.cpp
68885e38b86405b333e3f8fd4ff0a104889147c4 14-Dec-2016 Stan Iliev <stani@google.com> Modify savelayer to save matrix and clip for Skia pipeline

Modify SkiaCanvas::saveLayer to always save matrix and clip and
match HWUI behaviour. Also ensure android state tracking
behavior matches that of the Skia API (partial saves not
supported). This change is fixing SaveLayerAnimation
macrobench when buffer age is disabled.
Add a HWUI unit test that verifies clip and matrix are restored.

Test: built and ran angler-eng, ran hwui unit tests
bug:33429678
Change-Id: I62e429f9746518fef67663b0dd99ac499bf31af3
/frameworks/base/libs/hwui/SkiaCanvas.cpp
6e49c9f007c879f05b035c40c0ba543c00f9d0d0 02-Dec-2016 Mike Reed <reed@google.com> switch over clip calls to use SkClipOp instead of SkRegion::Op

Change-Id: I67d23c487b5249bc31d96e3b2393f693c0b2bcff
/frameworks/base/libs/hwui/SkiaCanvas.cpp
6acfe16b5650446dbdcce3bd779b52fb6533a41e 18-Nov-2016 Mike Reed <reed@google.com> SkCanvas is no longer reference-counted

Change-Id: Ie821efe7c0a7d1301715e303aaf4d7ec86ac35e7
/frameworks/base/libs/hwui/SkiaCanvas.cpp
e547dd0b80b819bbd377bd7de228737b10570aa0 09-Nov-2016 Derek Sollenberger <djsollen@google.com> Cleanup asserts and remove usage of deprecated data structure.

Test: compile only
Change-Id: I9e9f1a3fb37db043d76a98a9568679e7e531e283
/frameworks/base/libs/hwui/SkiaCanvas.cpp
c2f31df8b3b9a237e9abffc59c61804ad8495073 28-Oct-2016 Mike Reed <reed@google.com> use SkBlendMode

skbug.com/5814

Test: compile only
Change-Id: Ibbaff43df1117b2ca77fd8f917f03d88cc476330
(cherry picked from commit 26edbcba8a2ed4cb300e7f87e679e3b73cec2772)
/frameworks/base/libs/hwui/SkiaCanvas.cpp
021693b967a2c5556dddd183eb0247df4079e1ad 17-Oct-2016 Stan Iliev <stani@google.com> Implement SkiaRecordingCanvas, RenderNodeDrawable and other drawables.

Implement SkiaRecordingCanvas, RenderNodeDrawable, GLFunctorDrawable,
LayerDrawable, StartReorderBarrierDrawable, EndReorderBarrierDrawable.
Move AnimatedRoundRect and AnimatedCircle in a separate file.
All Skia pipeline files are moved in hwui/pipeline/skia folder.
Add unit tests for RenderNodeDrawable, StartReorderBarrierDrawable,
EndReorderBarrierDrawable and SkiaRecordingCanvas.

Test: I tested manually on 6P devices and did run the unit tests.
Change-Id: If2a347bd1fc4689953822294ce5bf98c7f3f57c7
/frameworks/base/libs/hwui/SkiaCanvas.cpp
7de73858975fc4dbccfa1c188f6d1a12d39ce2c5 26-Oct-2016 Matt Sarett <msarett@google.com> Implement getTransparentRegion() using SkLatticeIter

This allows us to delete utils/NinePatchImpl.cpp and
utils/NinePatch.h

Test: Passed cts tests - DrawableTest, NinePatchTest,
NinePatchDrawableTest.

Change-Id: I6b5d09fa3479e758d8b931fa0e977c25f4435a7c
/frameworks/base/libs/hwui/SkiaCanvas.cpp
f50806afb8982acbab4510a8d04bbcf13a2bcd9e 24-Oct-2016 Stan Iliev <stani@google.com> Merge SkiaCanvas changes from master-skia to master branch.
Most changes are taken from ag/1407698, ag/1336660, ag/1488900.

Test: Built and run manually on angler-eng.
Change-Id: Id4e464b9a83c62b6bc7ea31a30e5ca6cd53b659d
/frameworks/base/libs/hwui/SkiaCanvas.cpp
5fd2a1cb2726afa7d40fe4750e9defd89c24ed37 21-Oct-2016 sergeyv <sergeyv@google.com> Pass Bitmap instead of SkBitmap in drawNinePatch & drawBitmapMesh
Test: refactoring cl.
bug:32216791

Change-Id: I5adcd59daf752d36012456b0a9960c59d07e2e3d
/frameworks/base/libs/hwui/SkiaCanvas.cpp
fc9999505a36c66892d7ccce85187936105f4f36 17-Oct-2016 sergeyv <sergeyv@google.com> Pass Bitmap instead of SkBitmap for bitmap rect operation
Test: refactoring cl.
bug:32216791

Change-Id: I66d19194c57b3aa2c400aa87acffc774a533776a
/frameworks/base/libs/hwui/SkiaCanvas.cpp
aed7f58fb05a25ce2112829e77c0eb5dd268e8a7 15-Oct-2016 sergeyv <sergeyv@google.com> Pass Bitmap instead of SkBitmap in canvas.drawBitmap(Bitmap, float,float,Paint)
Test: refactoring cl.
bug:32216791

Change-Id: If9f9fbc19e683b14cce6c3c268258bd832d495d2
/frameworks/base/libs/hwui/SkiaCanvas.cpp
260ab726486317496bc12a57d599ea96dcde3284 07-Oct-2016 Mike Reed <reed@google.com> use SkBlendMode instead of SkXfermode
use sk_sp versions of paint setters/getters

Change-Id: I86591a0a8ec92e6039776cbf00424ea24f585b28
/frameworks/base/libs/hwui/SkiaCanvas.cpp
d4babda3aa0af4d9a060b588f082e2f29192fd60 20-Sep-2016 Matt Sarett <msarett@google.com> Merge "Use SkMakeBitmapShader, avoid bitmap copy"
62feb3a0b4690144a067080ab17beae160ea6320 20-Sep-2016 Matt Sarett <msarett@google.com> Use SkMakeBitmapShader, avoid bitmap copy

CreateBitmapShader now forces a copy. This updates the call sites
to use SkMakeBitmapShader (in SkImagePriv.h) with
kNever_SkCopyPixelsMode.

This maintains the behavior where apps can modify the bitmap in
the shader after creating the shader.

This also ensures that the texture cache will work (since it's
based off of SkPixelRefs).

BUG:31594626
Change-Id: Ic75cb6cdc05c750b7946208e48a8127838d9c2f8
/frameworks/base/libs/hwui/SkiaCanvas.cpp
cbba84d6fc1164dde06121443929ec0f22ff068e 15-Sep-2016 Yuqian Li <liyuqian@google.com> Ignore HasAlphaLayer flag to fix b/30929229 am: 83427ff222 am: df6b413b63
am: 49d49fafb8

Change-Id: Ie454b7160dc04952dc7240bfdf004e249bc9e792
49d49fafb86b0af03e16af73b0fc3d7e37bdb2cc 15-Sep-2016 Yuqian Li <liyuqian@google.com> Ignore HasAlphaLayer flag to fix b/30929229 am: 83427ff222
am: df6b413b63

Change-Id: I994233a48472cd2d11acaa30673504b8589bc303
83427ff2224c89cc1a590ea609206c95c8ee039e 14-Sep-2016 Yuqian Li <liyuqian@google.com> Ignore HasAlphaLayer flag to fix b/30929229

BUG:30929229
Change-Id: Iebadc6b3d224efa0554cbbb99ea43f871c28722b
/frameworks/base/libs/hwui/SkiaCanvas.cpp
afc221499d943386256feb9db46c119ff834bf79 18-Jul-2016 Yuqian Li <liyuqian@google.com> More efficient text rendering on path

Change-Id: I004c15473b527df0f296c54a6a3e9b29505fd9b9
/frameworks/base/libs/hwui/SkiaCanvas.cpp
86cbf883f6bded03841db3038e75d18afd5f6095 20-Jul-2016 Derek Sollenberger <djsollen@google.com> Fix ref-counting error when reseting a SkiaCanvas with a new SkCanvas.

Change-Id: Id2ed6627674cbd3112d6ac80f4e29a5ff65606b6
/frameworks/base/libs/hwui/SkiaCanvas.cpp
c190813b938ecf28d9e76b07098e9637ced8808e 15-Jul-2016 Derek Sollenberger <djsollen@google.com> Expose SkiaCanvas header file.

Previously the header for SkiaCanvas was contained in the .cpp file,
but in prepration for broader use of SkiaCanvas we are moving the
header into its own .h file.

Change-Id: Ib8c738366198a9b63e7429d51e9fa5aec106fdb1
/frameworks/base/libs/hwui/SkiaCanvas.cpp
c968879eb69d933fa260f43605a124a6dc7d0ea3 28-Apr-2016 Chih-Hung Hsieh <chh@google.com> Merge "resolve merge conflicts of 1599b981 to nyc-dev-plus-aosp am: 85e0c89ba5" into nyc-mr1-dev-plus-aosp
am: 99feacb026

* commit '99feacb0263f8331e9afcbfdbc0a4322de75593c':
Fix google-explicit-constructor warnings.

Change-Id: Ifb8bda3157f17c400ae403056bbef3b3c3625ea8
85e0c89ba55188ecc484538efbfdb570606fc1a2 28-Apr-2016 Chih-Hung Hsieh <chh@google.com> resolve merge conflicts of 1599b981 to nyc-dev-plus-aosp

Change-Id: I90807581e10b6a0024515ff634ac8b29eaa5fc9f
fd92ee4b731bee39f8b100cd138fb491de9d66ee 27-Apr-2016 Yuqian Li <liyuqian@google.com> Remove SkTLazy

Change-Id: Ibce5cea66fe67fceb994ff45c9afb527dbaf641b
/frameworks/base/libs/hwui/SkiaCanvas.cpp
c6baf563ba6aa207a48317c177b29f1d2b70cf3d 27-Apr-2016 Chih-Hung Hsieh <chh@google.com> Fix google-explicit-constructor warnings.

Bug: 28341362
Change-Id: Ibdd6a210bb7ff228e3624cc319169f77aca3b51e
/frameworks/base/libs/hwui/SkiaCanvas.cpp
cd1c3eba69d044b551cededad75474038f919890 14-Apr-2016 John Reck <jreck@google.com> Add a callback for when a gl functor is released

Bug: 27709981

Change-Id: Id5be3e8f88d6d84a9c59c7ed23e7e8862feefbe8
/frameworks/base/libs/hwui/SkiaCanvas.cpp
1d8e194661085f9a18ab1b3cd12f9e19d3a86be5 03-Mar-2016 Doris Liu <tianliu@google.com> Make AVD thread safe

This CL introduces staging properties to VectorDrawable, which holds
properties coming from UI thread. When staging properties are changed,
they are marked dirty, and the staging properties then get pushed to
RenderThread at sync point. In cases where no staging property has
been changed, at sync point we sync the render thread properties back
to staging properties to reflect the latest render thread animation
value change.

Also, update Vector Drawable bitmap only when it's dirty

Bug: 27343970
Bug: 27385912
Bug: 27263667
Bug: 27927674
Bug: 27774383

Change-Id: Ia864f5400a53a08dbfb284fae581fb1aac4fff87
/frameworks/base/libs/hwui/SkiaCanvas.cpp
79abbf22d4f672208327546661e694d837f564a9 24-Mar-2016 Derek Sollenberger <djsollen@google.com> Update HWUI tests to use minikin to layout fonts.

This update is a precondition for landing additional tests
that depend on the minkin layout implementation.

bug: 27675371
Change-Id: I9bb98bae6b39462246e42cf8acb968b7df05292d
/frameworks/base/libs/hwui/SkiaCanvas.cpp
dccca44ffda4836b56a21da95a046c9708ffd49c 21-Mar-2016 sergeyv <sergeyv@google.com> Reland: Move text logic from jni to hwui level

Initial CL: https://googleplex-android-review.git.corp.google.com/#/c/886854/

Change-Id: I9dfd85fe1d2a2c44f4360c8a29fd58d80e6f31c8
/frameworks/base/libs/hwui/SkiaCanvas.cpp
afbd0f1fef46ef0ddf633dfde0de724db3da1405 21-Mar-2016 Sergei Vasilinetc <sergeyv@google.com> Revert "Move text logic from jni to hwui level"

This reverts commit a7f6bba1a3565c19715e878dfe7f0e01022944ff.

Change-Id: If4f36f87a85411b6128fd92d391313803ccaf9dd
/frameworks/base/libs/hwui/SkiaCanvas.cpp
a7f6bba1a3565c19715e878dfe7f0e01022944ff 16-Mar-2016 sergeyv <sergeyv@google.com> Move text logic from jni to hwui level

bug:25865834
Change-Id: I2d8c9c9544afcb5ce1784f732aed3e54e0eda372
/frameworks/base/libs/hwui/SkiaCanvas.cpp
766431aa57c16ece8842287a92b2e7208e3b8ac3 04-Feb-2016 Doris Liu <tianliu@google.com> Revert "Revert "VectorDrawable native rendering - Step 4 of MANY""

This reverts commit 5a11e8d0ba21624025b89ac63bbd18befa55be0e.

Change-Id: I7a48b59c4f930dad65ddc8590c25a12636244ea2
/frameworks/base/libs/hwui/SkiaCanvas.cpp
5a11e8d0ba21624025b89ac63bbd18befa55be0e 04-Feb-2016 Doris Liu <tianliu@google.com> Revert "VectorDrawable native rendering - Step 4 of MANY"

b/26949340 and b/26975469, b/26975079 as well

This reverts commit f276acd98457bcaabc9e79a17a736b3b484f005e.

Change-Id: I4b55177daf0d289bc03604c71fd4bf579f65073a
/frameworks/base/libs/hwui/SkiaCanvas.cpp
6f485569fa3d6047dcffd068aebf361e3598783c 30-Jul-2015 Derek Sollenberger <djsollen@google.com> Update Canvas API with view system calls.

Refactor DisplayListCanvas, RecordingCanvas, and SkiaCanvas
to share a common API.

Change-Id: I0268ec2749ea5d13a3a72bb2784ed6a9911383d9
/frameworks/base/libs/hwui/SkiaCanvas.cpp
f276acd98457bcaabc9e79a17a736b3b484f005e 07-Jan-2016 Doris Liu <tianliu@google.com> VectorDrawable native rendering - Step 4 of MANY

This CL runs VectorDrawable animation on RenderThread. The changes in this CL
include:
- Convert all the animators in AnimatorSet for AVD into a set of RenderNodeAnimators.
- Hook up the new animators with RenderThread
- Add drawOp in RecordingCanvas for drawing VD so that during the animation
on RenderThread, all the property changes on VD can be reflected on the screen.

TODO:
- Implement reverse and reset for AVD.

Change-Id: I2df1d754f2db0ad098d9c15dde4bb2bdfafc2315
/frameworks/base/libs/hwui/SkiaCanvas.cpp
eecff56fed5dd5206acfbc5007b4912081b36d3b 21-Dec-2015 Florin Malita <fmalita@google.com> Add internal Canvas save flags

Skia's SkCanvas::SaveFlags are being deprecated. This CL introduces
the equivalent android::SaveFlags, converts all internal clients to
the new enum, and switches the saveLayer glue to the
SaveLayerRec-based API.

Change-Id: Icb1785f4e7c0f652b1f04b34a1e3ccb063c408f3
/frameworks/base/libs/hwui/SkiaCanvas.cpp
a1717271caac5e8ea3808c331d4141ac01a42134 19-Nov-2015 Chris Craik <ccraik@google.com> Initial text support in new reorderer/renderer

Removes obsolete drawPosText codepath, and unifies text decoration behavior.

Change-Id: I9c563249ab688a3394445a0e7fe1b9d0661f6f7c
/frameworks/base/libs/hwui/SkiaCanvas.cpp
5e27140f48a1ec0ae3890dca84bfa91bd32ecb3b 04-Nov-2015 Florin Malita <fmalita@google.com> Fix persistent Canvas clip handling

Partial Canvas save semantics (clip or matrix persisting after restore)
are currently emulated in the native canvas wrapper (SkiaCanvas.cpp).

Persistent clips (save w/ MATRIX_SAVE_FLAG only) in particular are
emulated using the SkCanvas clip stack. There are two problems with
the current implementation:

1) The canvas save count is used to identify the clip stack topmost
frame, on the assumption that it is the same as the actual clip stack
save count. But with the introduction of lazy SkCanvas saves in Skia,
the two values can diverge: the clip stack save count only reflects
*committed* saves, while the canvas save count includes both committed
and pending saves. This means that we can no longer compare canvas and
clip stack save counts directly.

While we're looking at addressing the save count discrepancy in Skia
proper, we can also refactor the partial save emulation to no longer
rely on the two values being synchronized: instead of using the canvas
save count to locate the top clip stack frame, simply use the clip
stack save count for the same purpose - getClipStack()->getSaveCount()
always points to the correct top clip stack frame.

With this patch:

* we use SkCanvas::getSaveCount() to track *canvas* save frames which
require persistent matrix/clip handling (mSaveRecStack)
* we use SkClipStack::getSaveCount() to extract the clips from the
top clip stack frame

Also, since we're no longer mixing/comparing the two save counts, we
don't have to decrement the canvas value anymore (to make it zero-based
like its clip stack counterpart).

2) When iterating over clip stack elements, we currently start at
kTopIterStart and advance using next(). This is incorrect as next()
moves up the stack, so we only iterate over the topmost element =>
if there are multiple (non-consolidated) clip elements in the top
frame, we only get to see one.

We need to iterate using prev() instead.

Change-Id: Ic2d8cad684018925e749b9172fbf7c6202d9fb62
/frameworks/base/libs/hwui/SkiaCanvas.cpp
f35b989d26bb98900f6c5fa2e586326b30b6e161 31-Jul-2015 Leon Scroggins III <scroggo@google.com> Merge six commits from master-skia to master

Also corrects some code under development behind the HWUI_NEW_OPS flags
to match the updated Skia API.

Include external/skia/include/private
use SrcConstraint for drawBitmapRect
clean up to allow removal of flags for SCALAR_DIV and IMAGEINFO_FIELDS
don't call DEPRECATED getDevice()
update to newer API for drawBitmapRect
asABitmap is deprecated, used isABitmap

previous-Change-Id: I12208855a95948897077b1c1549eb35416cc801e
previous-Change-Id: I5044f0f61315fe48c60d7af5e261a7d0ed574f56
previous-Change-Id: Ic34a3ba77b3f9e091fa7aaba75018a307abacdab
previous-Change-Id: I79f8dd779920565d1204f7fe67b3286b1bbf4e9b
previous-Change-Id: Ic04d1f8274f6a862ea00f8d241363cf31f5ec1ec
previous-Change-Id: I9e4ae257a1976c74302b6a73f17405174ae58cec
previous-Change-Id: I85de3462ad1e4877784df38edc4bcd0acbd24e5e
Change-Id: Ide8e2f669e91a13c32521af3a16efdaa085c81d0
/frameworks/base/libs/hwui/SkiaCanvas.cpp
d8f904f256b82e48e9a85561eb96e15399b0b2d9 28-Oct-2015 Tom Hudson <tomhudson@google.com> Revert "Merge six commits from master-skia to master"

This reverts commit 550780745fa28ae9a87d02331841ca5ce4f9c763.

Change-Id: Ic71eccea454b26261fe6e9a9a7a24eff56396989
/frameworks/base/libs/hwui/SkiaCanvas.cpp
550780745fa28ae9a87d02331841ca5ce4f9c763 31-Jul-2015 Leon Scroggins III <scroggo@google.com> Merge six commits from master-skia to master

Include external/skia/include/private
use SrcConstraint for drawBitmapRect
clean up to allow removal of flags for SCALAR_DIV and IMAGEINFO_FIELDS
don't call DEPRECATED getDevice()
update to newer API for drawBitmapRect
asABitmap is deprecated, used isABitmap

Change-Id: I519f54f97321a7a365ea81a3b78cb03b9bdca021
previous-Change-Id: I12208855a95948897077b1c1549eb35416cc801e
previous-Change-Id: I5044f0f61315fe48c60d7af5e261a7d0ed574f56
previous-Change-Id: Ic34a3ba77b3f9e091fa7aaba75018a307abacdab
previous-Change-Id: I79f8dd779920565d1204f7fe67b3286b1bbf4e9b
previous-Change-Id: Ic04d1f8274f6a862ea00f8d241363cf31f5ec1ec
previous-Change-Id: I9e4ae257a1976c74302b6a73f17405174ae58cec
/frameworks/base/libs/hwui/SkiaCanvas.cpp
b03198de9f3c1e6f16367d25e9b2ae8bf540b379 20-Aug-2015 Ben Wagner <bungeman@google.com> Merge "Use static_assert instead of SK_COMPILE_ASSERT."
e3a40ea488c7cfa396d5901255719a6ddab791d4 19-Aug-2015 Ben Wagner <bungeman@google.com> Use static_assert instead of SK_COMPILE_ASSERT.

Now that static_assert is allowed, there is no need to use a non-
standard compile time assertion.

Change-Id: I0b294efcf494983f8241e9d5a2c476e2f2a9fff0
/frameworks/base/libs/hwui/SkiaCanvas.cpp
6daa13c5fa7577fa1d8371deca446f6ca911f38f 19-Aug-2015 Chris Craik <ccraik@google.com> Change setMatrix behavior to only affect canvas-local matrix

bug:22189925

This makes setMatrix(getMatrix()) work as expected, and makes setMatrix()
much more useful without changing behavior relative to a View's parent
hierarchy.

Change-Id: I608613bd27c1b9052ae583f8fd2119cf37a2f6d7
/frameworks/base/libs/hwui/SkiaCanvas.cpp
d1cbc1608906302130158acc4c72c82c89b49e10 19-Aug-2015 Ben Wagner <bungeman@google.com> Use 'new' instead of 'SkNEW'.

There isn't any good reason for Android code to be using SkNEW,
and in some places it is potentially an issue. Also, SkNEW really
should be considered private to Skia at this point.

Change-Id: I35c675bd2c45b7a65c526508c202a30e30859491
/frameworks/base/libs/hwui/SkiaCanvas.cpp
6bbf68d05a9deb335fc693b4a64651aea1b4e9e0 19-Aug-2015 Ben Wagner <bungeman@google.com> Remove use of SkAutoSTMalloc from Android.

Skia desires to make SkTemplates.h private since the classes there
are designed only for internal use.

Change-Id: I1e05e54de9eb68e50ccd6a691889fecf34bc9cea
/frameworks/base/libs/hwui/SkiaCanvas.cpp
edca320a2b42011f98c308fdf25fc0494c6a5454 10-Jul-2015 Derek Sollenberger <djsollen@google.com> Add ninePatch support to Canvas.h

Change-Id: Ib3202fd7c5b9f35853f286abe84b3ed009df1a81
/frameworks/base/libs/hwui/SkiaCanvas.cpp
60126efd7d905ca24822765c6dafac17fef278ab 07-Aug-2015 Ben Wagner <bungeman@google.com> Use unique_ptr instead of SkAutoTDelete.

Skia would like to make SkAutoTDelete private, given that unique_ptr
now exists and is a better standard alternative.

Change-Id: Ie21bc4546c93e2096c1e43b26eb3ef80b8f11de4
/frameworks/base/libs/hwui/SkiaCanvas.cpp
6578a989566e585eee053095dc80e2552e125db2 13-Jul-2015 Derek Sollenberger <djsollen@google.com> Support High Contrast Text for all canvas types

Change-Id: Iee324446798fe1a1cb32cb991f181a4af24aa93c
/frameworks/base/libs/hwui/SkiaCanvas.cpp
749e67438c7e2dbe2bb362dc07522a1702810455 29-Jul-2015 Chris Craik <ccraik@google.com> Revert "Support High Contrast Text for all canvas types"

bug:22820834

This reverts commit 876d56612ab8ec7032f702905d694670e6c4febd.

Change-Id: I4e07a0894095caaaf2fd36bfa6073d033542bfc4
/frameworks/base/libs/hwui/SkiaCanvas.cpp
876d56612ab8ec7032f702905d694670e6c4febd 13-Jul-2015 Derek Sollenberger <djsollen@google.com> Support High Contrast Text for all canvas types

Change-Id: Ib46ba3d7c67e081872e6a4b11d294fe9a61f5bbd
/frameworks/base/libs/hwui/SkiaCanvas.cpp
94394b3fb048d5349a77b57950ab7f6b6e92ce34 10-Jul-2015 Derek Sollenberger <djsollen@google.com> Move drawRegion from DisplayList to Canvas

Change-Id: I9f401dc5b24732938ac2ca7ed829796e2d7ef3e8
/frameworks/base/libs/hwui/SkiaCanvas.cpp
ac7b6d33d23cb0baaf61c723346198d41f012035 30-Jun-2015 Tom Hudson <tomhudson@google.com> New setLocalMatrix() operation for HWUI

Concats any matrix passed through from DisplayListCanvas with the
initialTransform of the containing RenderNode.

BUG:22189925

Change-Id: I5ea54a6e2a29520c79a8860bde7682694e8595d2
/frameworks/base/libs/hwui/SkiaCanvas.cpp
5ec6a2878b2ad933c5da6fe2341c854155acc24c 24-Jun-2015 Chris Craik <ccraik@google.com> Unify clipping return value behavior - true if not empty

bug:22035484

Change-Id: I23ecca38554a60c590181290900deb0e2c48cea1
/frameworks/base/libs/hwui/SkiaCanvas.cpp
c1b33d665c8caf5760f68c45c6ca0baa649b832a 22-Apr-2015 John Reck <jreck@google.com> GraphicsJNI Canvas cleanup

Change-Id: I72e142986a8bc9f464c1951b6b5187919de3462e
/frameworks/base/libs/hwui/SkiaCanvas.cpp
9d4efdf2802f06ccf7031610891f75af70ea5538 17-Apr-2015 John Reck <jreck@google.com> Revert "A bunch more cleanups"

This reverts commit c294d128d03bc9a9982b273a82516c04583438cc.

Change-Id: Id1ebb236950f7c36c6d86e1dd95566d3a200748d
/frameworks/base/libs/hwui/SkiaCanvas.cpp
f7a61483bc2a763145b0f1b6e6809c44cdc97187 15-Apr-2015 John Reck <jreck@google.com> Merge "A bunch more cleanups"
c294d128d03bc9a9982b273a82516c04583438cc 14-Apr-2015 John Reck <jreck@google.com> A bunch more cleanups

Switch a few places to using android::canvas
instead of SkCanvas as well which eliminated
some JNI

Change-Id: I8f98b56442a06362b82b984cd1bd3a92398d8dbc
/frameworks/base/libs/hwui/SkiaCanvas.cpp
34e79c1e570673148e3e0bbd91df3180a00eeff1 14-Apr-2015 Tom Hudson <tomhudson@google.com> Convert from glyph count to byte length

Canvas drawText* APIs are inconsistent, and this mismatch snuck through
our tests.

BUG=skia:3636
R=djsollen@google.com

Change-Id: Ibaab512c3f19df8445d582633b2748f1ec4d2902
/frameworks/base/libs/hwui/SkiaCanvas.cpp
0313f2680c91985f413675c283805088960b9a54 05-Mar-2015 Derek Sollenberger <djsollen@google.com> Remove uncessary include for SkPorterDuff.h

Change-Id: Ibcbed5dd2dc327821fc26e87191185f0069c9911
/frameworks/base/libs/hwui/SkiaCanvas.cpp
b3d50e007523d1ada0866d384c391c72ac1a3577 29-Jan-2015 Derek Sollenberger <djsollen@google.com> Rename Canvas::getSkCanvas to Canvas::asSkCanvas

Change-Id: I967a45698d382e54eaa5ff64fa8909ff00908650
/frameworks/base/libs/hwui/SkiaCanvas.cpp
849911a9c4315fc552faa38516c842b2541b1909 20-Jan-2015 John Reck <jreck@google.com> Move Canvas

Change-Id: I83d557af30fc2d5c69d06eedc0f4d52ac41c4210
/frameworks/base/libs/hwui/SkiaCanvas.cpp