Bug 17452965
A single point Path (move-to only) was not returning any
verbs in the verb list. This forces an approximation for
single move-to and empty paths by giving the same value
for fraction 0 and fraction 1.
Change-Id: Icb1b932d730457680cf422377a83fe669f0a7687
A user may request a subset of the document's pages to be printed.
In this case the expectation is that the resulting document does
not include not selected pages. While print serivices can do the
trimming themselves or the printer may do so, moving, potantually
many, redundant pages is inefficient. The real problem is when
saving to a PDF file where the saved file must not have the pages
the user did not select. This change adds shredding of undesired
pages from the PDF before saving it or passing it to a print service.
:
bug:17285994
Change-Id: I7deba535af99457bea3c118202314f0f3812e809
ninePatchInsets could be null after allocation, this possibly caused
a SIGABRT in GC or check_jni failure.
Bug: 17323232
Change-Id: Icd7e3819032e8e999d3c1483bf261bb39b3fe9e4
The GetGlyph function returns a boolean indicating whether the glyph
exists in the font. However, we were testing the pointer, so the test
would always succeed even if the glyph was missing. This interfered with
fallback algorithms for rendering compatibility characters.
Bug: 15816880
Bug: 16856221
Change-Id: I95cd45bb8f5e8ddf74cf23e6e624fbf30172e00a
Parse new fonts.xml config file, and resolve weight selection based on
the base weight of the font (as defined by a weight alias specified in
the config file) and the requested bold flag. This change improves the
appearance of bold spans for alternate weights of Roboto.
In addition, this patch enables weight selection for fallback fonts.
For example, if an additional font with a weight of 100 is added to the
Hebrew font family in the fallback list, then requesting
"sans-serif-thin" would select that font for Hebrew text.
Bug: 14538154
Change-Id: I99a04fad4f7bf01c75726e760d42735dd9003496
The copy constructor for Paint was setting default values for additional
parameters, rather than copying them from the original object, resulting
in incorrect locale in the software text drawing path.
Fix for bug 17149910 "Chinese font is used on IME even if the system
language is Japanese"
Change-Id: I25f377ce4e0ea66946a27ea46a2db524872ae36f
bug:17114103
Better handle the case, when scaling the divs in a nine patch, where
divs fall outside of the bounds of the bitmap.
Change-Id: I244b9c45b938c2a15f29e4563a86825ee9439b5f
bug:16140822
bug:16566746
This allows background drawables to alter the opacity of a shadow
being cast with their own alpha values.
Change-Id: I49698cc7c1bf4b2b55ffe2f82899543ca62bc61c
Both the Canvas and Picture objects will unref the canvas in their
finalizers, so an extra ref is needed. This had been present but was
inadvertently removed in the patch "Refactor android.graphics.Picture
JNI bindings." This patch simply restores the previous ref and comment.
Bug: 16399257
Change-Id: I9911826bd0e668bd25546ef54b0c9c1d467538c8
Fixes a bug introduced in I3c3316377874e89fccc85afb864bc038b0ef3890.
CreateLocalMatrixShader combines the existing matrix with the new
matrix, which is not what we want. Keep track of the original
SkShader at all times, and always create the local matrix shader
with the original. Store the SkShader with a local matrix as
Shader.native_with_local_matrix.
Make Shader.native_instance private. Instead of allowing direct
access, add an init() method which sets it, and getNativeInstance(),
which returns either native_instance or native_with_local_matrix,
as appropriate.
Make Shader subclasses call init(), instead of setting native_instance
directly.
Pass native_with_local_matrix pointer to nativeSetLocalMatrix and
nativeDestructor, which unrefs it (if not null).
Since nativeSetLocalMatrix no longer replaces the original, do not
unref it.
Add a comment to Shader.updateLocalMatrix that it does not affect
ComposeShaders created with this Shader. (This should have been a
part of I3c3316377874e89fccc85afb864bc038b0ef3890.)
BUG:16293121
Change-Id: Ieb31c7e1fe99081f6b81493178f4a18d3c5df643
Symptom: SkBitmap::getAddr(int, int) may return NULL due to unrecognized config
(ex: kRLE_Index8_Config). This will cause memcmp method to crash. Since bm0 and
bm1 both have pixel data() (have passed NULL == getPixels() check), those 2
bitmaps should be valid (only unrecognized), we return JNI_FALSE to warn user
those 2 unrecognized config bitmaps may be different.
Cherry-pick of 3a1bffa835f279628e50385af3c85789bc737f64 from AOSP
Change-Id: I6970c27de412110a3035d0a783112c4cd3ebc35b
The idea is that extra paint parameters that only affect text layout
(not rendering) will go in android.Paint instead of going into
SkPaintOptionsAndroid. We will eventually move those out of SkPaint
too.
This is currently implemented in PaintImpl.cpp. Will be renamed when
current Paint.cpp that has JNI bits is moved to android_graphics_Paint.cpp.
Change-Id: Iba66c34dea5da503a13b9c864cb9f2211ac4ba7d
This introduces Canvas.h which is a pure virtual interface that
is intended to be used by both Skia and HWUI implementation. To help
stage this transition this CL only introduces the interface and Skia
implementation. The interface is not intended to be final and will
undoubtedly go through iterations in both style and location as we
look to introduce the HWUI implementation.
BUG:15672762
Change-Id: Ibaccdddb87d3b9358f4f0c1d317ead5282d4ee16
This reverts commit e28a5afee885cd69a5be5809f88116b601cb1a72.
Appears to cause memory corruption and random appearances of
chinese
Bug: 16343240
Bug: 16336642
Change-Id: Ife169181f40adff4b12948ed5f9d3a88dcec935b
This introduces Canvas.h which is a pure virtual interface that
is intended to be used by both Skia and HWUI implementation. To help
stage this transition this CL only introduces the interface and Skia
implementation. The interface is not intended to be final and will
undoubtedly go through iterations in both style and location as we
look to introduce the HWUI implementation.
BUG:15672762
Change-Id: Idefadede356f688edb8eb09b4a02aa01b4077f62
b/15856895
Nine patches now have outline round rect metadata stored as optional
png tags. aapt generates these automatically by inspecting the bitmap
pixels to estimate outline bounds and round rect radius, based on
opacity.
Change-Id: I226e328a97873010d9e1adb797ac48f93a31183c
Previously, calling setLocalMatrix updated any Paint that had the
Shader attached. This depended on deprecated behavior in Skia. Use
new Skia APIs, and do not modify any Paints that use the Shader.
In addition, update callers to call setShader (again) after modifying
the Shader.
Sample app at ag/499573 for testing.
Depends on I673801444f0a8fd4f192b5b7effdde1aa83e702b in external/skia.
BUG:14315916
Change-Id: I3c3316377874e89fccc85afb864bc038b0ef3890
This change adds the pring preview part of the new print UX. The
UI has two parts, the top section is the print options and the
bottom section print preview with a list of pages. The user can
interact only with one of them. When print options are expanded
they cover the preview content and a scrim is laid out on top of
the preview. Tapping the scrim collapses the print options. When
the user types in page ranges and closes the options to look at
the preview, the latter is updated to show only these pages. In
the list of pages the user can further prune pages by deselecting
them.
Change-Id: I0b23d2c598afe2a34400ccfa43e4e935af83c72f
Creating a typeface from a missing file crashes when it tries to extract
the style from the font. This patch just uses default style when the
resulting font object is NULL.
Bug: 15930808
Change-Id: I9438687100026f336db7aa204fe3a0232eee2db6
Replace the Java variable with mRequestPremultiplied, to better
reflect what it represents. In both native and Java, the SkBitmap
is used as the decision maker of whether a Bitmap is premultiplied.
When changing other settings, mRequestedPremultiplied is used to
determine whether it should be premultiplied (if the new config/
hasAlpha-ness etc supports it).
ChooseFromColorProc now reads both the colortype (instead of the
deprecated Config) and alphatype on the SkBitmap. Same with
ChooseToColorProc. In the process, this caught a bug, where the
wrong procs were being used for Index8.
Replace instances of SkBitmap::Config with SkColorType where I
was already changing code.
Use the new versions of setConfig/allocPixels that take an SkImageInfo
as a parameter.
Document isPremultiplied's return value for ALPHA_8.
BUG:13618134
Change-Id: I91fc1f1e46e9294364b1af0ab4bdb37c68d7058e
Adds a constructor that doesn't require a GLES texture name and sets
up the SurfaceTexture in detached mode.
Bug: 15616428
Change-Id: I375495f481bfbe43b3830ab7d124cef8f1be0ac6
Other files were including GraphicsJNI.h and didn't have Minikin in the
include path. This patch eliminates the offending include.
Change-Id: I05c9dbf80b93f1731fd0192015e2c9c68a9dd3c6
This patch switches all text layout operations to use Minikin, removes
the USE_MINIKIN #ifdef, and deletes some of the code that was only used
in the old TextLayout path (although some more refactoring remains).
Change-Id: I51b5c4e2bb46cfd9d204c12b9f16f135c769f5b5
The Paint.getTextGlyphs() method was used for testing the old Arabic
shaper and is entirely obsolete. Note that this is the very last
dependency (other than some enums in the header) for the old TextLayout
code path.
Change-Id: I7b596f0c0942ed50987fc8e0478cd93e667f1f9e