At the JNI bridge, Region::Op::kReplace_Op is detected and sent to new functions on Canvas.h -> emulateReplaceClip[Rect|Path]. The SkiaCanvas implementation calls SkAndroidFrameworkUtils::ResetClip to turn the SkCanvas' clip wide open (modulo the device clip restriction), followed by an intersect op with the actual clip geometry. SkiaCanvas is also updated to record the replace ops in its Clip struct for partial saves. This should result in no visible behavioral change at the Java Canvas level, but allows the removal of the SK_SUPPORT_DEPRECATED_CLIPOPS flag. Test: Updated SkiaPipeline.clip_replace unit test to use the new emulateReplaceClipRect function instead of SkClipOp::kReplace. Builds and recently added CTS tests for clip ops pass. Bug: b/151725198 Bug: b/143352151 Change-Id: I8fb8765b4ead92bbe8eceadb52710a5673b6cf6b
55 lines
1.1 KiB
Plaintext
55 lines
1.1 KiB
Plaintext
/*
|
|
* Copyright (C) 2018 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
X(Flush)
|
|
X(Save)
|
|
X(Restore)
|
|
X(SaveLayer)
|
|
X(SaveBehind)
|
|
X(Concat)
|
|
X(SetMatrix)
|
|
X(Scale)
|
|
X(Translate)
|
|
X(ClipPath)
|
|
X(ClipRect)
|
|
X(ClipRRect)
|
|
X(ClipRegion)
|
|
X(ResetClip)
|
|
X(DrawPaint)
|
|
X(DrawBehind)
|
|
X(DrawPath)
|
|
X(DrawRect)
|
|
X(DrawRegion)
|
|
X(DrawOval)
|
|
X(DrawArc)
|
|
X(DrawRRect)
|
|
X(DrawDRRect)
|
|
X(DrawAnnotation)
|
|
X(DrawDrawable)
|
|
X(DrawPicture)
|
|
X(DrawImage)
|
|
X(DrawImageRect)
|
|
X(DrawImageLattice)
|
|
X(DrawTextBlob)
|
|
X(DrawPatch)
|
|
X(DrawPoints)
|
|
X(DrawVertices)
|
|
X(DrawAtlas)
|
|
X(DrawShadowRec)
|
|
X(DrawVectorDrawable)
|
|
X(DrawRippleDrawable)
|
|
X(DrawWebView)
|