Age | Commit message (Collapse) | Author |
|
This approach is much less likely to use an SkRegion and ends up working better for Webkit.
Review URL: http://codereview.appspot.com/4550057
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1375 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Add path effect handling for drawPoints (via drawPath).
Move path effect handling from drawRect to drawPath.
Add prePathMatrix support to drawPath.
BUG=crbug.com/82849
Review URL: http://codereview.appspot.com/4531047
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1354 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
http://codereview.appspot.com/4532064/
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1351 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
This change uses the soft mask (aka soft clip) functionality of PDF to implement the xfermodes. It has to put existing content (dst) into a form xobject as well as putting the new (src) content into a different form xobject. It then draws one of them with the other as the soft mask.
To accomplish this, we add a call to finishContentEntry after each call to setUpContentEntry - this is kind of a hack, but I don't see a better way to extract src.
Unfortunately, soft mask is specified in the Graphic State PDF object (and not in the form xobject), so when handling one of these modes, we add a one time GS object to set the soft mask and invoke a simple GS to reset the soft mask when done.
Review URL: http://codereview.appspot.com/4496041
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1320 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Chrome bug is crbug.com/82198.
Review URL: http://codereview.appspot.com/4515061
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1306 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
This makes text in PDFs searchable and copy&paste-able.
Code from arthurhsu@chromium.org. Original review: http://codereview.appspot.com/4428082/
Review URL: http://codereview.appspot.com/4525042
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1280 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Review URL: http://codereview.appspot.com/4532044
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1279 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
SkPDFGraphicState::GSCanonicalEntry::operator== was out of sync with SkPDFGraphicState::populateDict leading to graphic state objects with the same value.
Review URL: http://codereview.appspot.com/4516043
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1278 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
This uses the refactoring in http://codereview.appspot.com/4459041/ to add support for additional xfer modes. Calling setupContentEntry may affect previous content entries (removing, reordering, or modifying their clip) and indicates to the caller if it should draw the new item or not.
Review URL: http://codereview.appspot.com/4464043
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1271 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
The current approach of setting the existing clip just before drawing a layer into a device doesn't work. SkDevice::clear() uses existing clip before that and if we need to put the content in a transparency group (i.e. for SrcIn xfermode), we need a valid existing clip. Instead, change the factory to use a special constructor when creating a layer device.
Review URL: http://codereview.appspot.com/4495041
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1270 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Instead of writing all drawing and state updates into the final content stream immediately, this change creates a new ContentEntry each time the transform, clip, or paint changes. Drawing is done into a stream in the ContentEntry. When the consumer asks for the content, we combine all the ContentEntries with appropriate updates to the state (clip, transform, paint) in between. This allows us to modify the clip even after a drawing has completed. It also lets us remove ContentEntries with no drawing. Further optimization can be done to better use the stack features of PDF, for now we follow the previous model of having a single clip followed by a single transform on the graphic state stack.
Push rectangle logic into SkPDFUtil::AppendRectangle.
Change private functions to adhere to coding standards.
Review URL: http://codereview.appspot.com/4459041
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1269 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
The width and height we pass to SkDevice must be postive.
Shader can no longer use negative coordinates (without transform).
Shader unflip matrix should use same values as passed to SkPDFDevice (height).
Most Shader dictionary entries should be scalars and not ints.
Review URL: http://codereview.appspot.com/4454047
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1219 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Review URL: http://codereview.appspot.com/4435074
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1217 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1208 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Review URL: http://codereview.appspot.com/4426064
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1202 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1180 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
+ If the clip matches the initial clip, don't set the clip.
+ Don't change the transform for drawPaint.
Review URL: http://codereview.appspot.com/4424041
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1142 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Plus, fix ifdef for flate test.
Review URL: http://codereview.appspot.com/4420041
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1141 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
The argument still has a default value that does what most users will want, but provides more flexibility.
Chrome will use this change to support an initial translation of the origin to simulate a margin and to scale the entire content (needed on Windows).
When landing to Chrome, this will need http://codereview.chromium.org/6820038
Review URL: http://codereview.appspot.com/4373052
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1111 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
It should be the number of leaves below a given node, not the number of direct children in the node.
Review URL: http://codereview.appspot.com/4355044
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1082 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Review URL: http://codereview.appspot.com/4351046
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1050 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Add a template function to type safe-combine bits of a bit field.
Review URL: http://codereview.appspot.com/4313053
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1020 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Review URL: http://codereview.appspot.com/4272070
git-svn-id: http://skia.googlecode.com/svn/trunk/src@1011 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
glyph's advance is already base-1000
git-svn-id: http://skia.googlecode.com/svn/trunk/src@973 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
git-svn-id: http://skia.googlecode.com/svn/trunk/src@962 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
SkFontHost::GetAdvancedTypefaceMetrics.
Review URL: http://codereview.appspot.com/4273041
git-svn-id: http://skia.googlecode.com/svn/trunk/src@922 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
pdf shader code.
I briefly looked into making use of alloca, but that is also non-portable, and
deprecated in many environments. Fell back to the SkTDArray class as a common
denominator.
This problem was introduce by the following CL:
http://codereview.appspot.com/4239061/
git-svn-id: http://skia.googlecode.com/svn/trunk/src@912 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Use SKIA_PDF_SUPPORT=false to disable the PDF backend.
Review URL: http://codereview.appspot.com/4267046
git-svn-id: http://skia.googlecode.com/svn/trunk/src@906 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
- Shaders, or as they are referred to in PDF, patterns, are drawn in the coordinate system of the initial page, so when we canonicalize them, we have to consider the current transform and where they are constructed.
- Image shaders are tiled by default, this makes repeat and mirror modes easy, but means we have to draw a pattern as large as the current clip to support clamp mode.
- Gradient shaders are implemented with type 4 functions, which are basically small snippets of post script code. I've tried to make the code generation modular and heavily commented to make it easy to understand or expand.
Review URL: http://codereview.appspot.com/4239061
git-svn-id: http://skia.googlecode.com/svn/trunk/src@905 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
drawPaint() doesn't need +1 to fill its bounds
git-svn-id: http://skia.googlecode.com/svn/trunk/src@899 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
git-svn-id: http://skia.googlecode.com/svn/trunk/src@896 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
git-svn-id: http://skia.googlecode.com/svn/trunk/src@893 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
git-svn-id: http://skia.googlecode.com/svn/trunk/src@892 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
* Add a config flag to ignore the restrictions
* Apply restriction to both SkPDFScalar and scalars used in content streams.
* +/- 32,767 for the integer part.
* +/1 1/65536 for the fraction part.
Review URL: http://codereview.appspot.com/4240050
git-svn-id: http://skia.googlecode.com/svn/trunk/src@882 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Review URL: http://codereview.appspot.com/4245044
git-svn-id: http://skia.googlecode.com/svn/trunk/src@863 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Review URL: http://codereview.appspot.com/4231044
git-svn-id: http://skia.googlecode.com/svn/trunk/src@856 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
The PDF shader matrix is dependent on flip origin or not, so we need to set it at device creation time.
Review URL: http://codereview.appspot.com/4216046
git-svn-id: http://skia.googlecode.com/svn/trunk/src@855 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Review URL: http://codereview.appspot.com/4212044
git-svn-id: http://skia.googlecode.com/svn/trunk/src@853 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
A stream is a dictionary (with a couple particular entries) plus the data.
The common parent is useful for the shader implementation.
Review URL: http://codereview.appspot.com/4221045
git-svn-id: http://skia.googlecode.com/svn/trunk/src@852 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
git-svn-id: http://skia.googlecode.com/svn/trunk/src@831 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
- Change SkGraphicState to track and set the blend mode (xfermode) for modes built in to PDF (non porter duff modes + src over).
- Add SkXfermode::asMode() to retrieve xfermode as an enum for non porter duff modes.
- Move SkXfermode.cpp around a bit to support asMode() -- Generally move utility functions toward the top of the file.
- Make SkPDFFormXObject an isolated transparency group, as it used for saveLayer, which draws on transparent, not the device background.
- Set the graphic state in drawDevice and drawBitmap in order to get the right xfermode and alpha.
Review URL: http://codereview.appspot.com/4131043
git-svn-id: http://skia.googlecode.com/svn/trunk/src@774 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
This prevents two copies of the content stream from sticking around. It also fixes an invalid memory reference because SkCanvas::internalRestore deletes the device (maybe it should just unref) after drawing it onto the main device.
Review URL: http://codereview.appspot.com/4080056
git-svn-id: http://skia.googlecode.com/svn/trunk/src@773 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
SkSafeRef() and SkSafeUnref().
This is basically a bug waiting to happen. An optimizing compiler can remove
checks for null on "this" if it chooses. However, SkRefCnt::safeRef() relies on
precisely this check...
void SkRefCnt::safeRef() {
if (this) {
this->ref();
}
}
Since a compiler might skip the if-clause, it breaks the intention of this
method, hence its removal.
static inline void SkSafeRef(SkRefCnt* obj) {
if (obj) {
obj->ref();
}
}
This form is not ignored by an optimizing compile, so we use it instead.
git-svn-id: http://skia.googlecode.com/svn/trunk/src@762 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
drawDevice, like drawSprite should start from the identity transform instead of applying the passed translation on top of the current transform.
Review URL: http://codereview.appspot.com/4023066
git-svn-id: http://skia.googlecode.com/svn/trunk/src@757 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Renamed to SkAdvancedTypefaceMetrics.
Include Em size and return all metrics in unscaled font units.
Make retrieval of advances optional.
Reorder SkAdvancedTypefaceMetrics to be somewhat logical.
Change the types of fields in SkAdvancedTypefaceMetrics to their minimum required size.
Review URL: http://codereview.appspot.com/4121049
git-svn-id: http://skia.googlecode.com/svn/trunk/src@752 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Return ref'd objs where possible enabling removal of many SkRefPtr<> variables.
Review URL: http://codereview.appspot.com/4029051
git-svn-id: http://skia.googlecode.com/svn/trunk/src@750 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Fix copy-paste ref counting bug.
Change NOT_IMPLEMENTED macro to only assert in debug mode.
Review URL: http://codereview.appspot.com/4080048
git-svn-id: http://skia.googlecode.com/svn/trunk/src@748 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Fix bug in rendering paths with cubic segments.
Only compress data if the compressed size is smaller than the uncompressed size.
Review URL: http://codereview.appspot.com/4079048
git-svn-id: http://skia.googlecode.com/svn/trunk/src@747 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Review URL: http://codereview.appspot.com/4083045
git-svn-id: http://skia.googlecode.com/svn/trunk/src@745 2bbb7eff-a529-9590-31e7-b0007b416f81
|
|
Review URL: http://codereview.appspot.com/4068044
git-svn-id: http://skia.googlecode.com/svn/trunk/src@729 2bbb7eff-a529-9590-31e7-b0007b416f81
|