mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-04 21:27:41 +08:00
View.setAlpha can be usedwithout LAYER_TYPE_SOFTWARE
This commit is contained in:
parent
d0fa48c6e8
commit
6faa2a831a
@ -8,4 +8,7 @@ SET(CMAKE_SYSTEM_PROCESSOR arm)
|
|||||||
SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-g++)
|
SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-g++)
|
||||||
SET(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-gcc)
|
SET(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-gcc)
|
||||||
SET(CMAKE_ASM_COMPILER ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-gcc)
|
SET(CMAKE_ASM_COMPILER ${TOOLCHAIN_DIR}/bin/arm-linux-gnueabihf-gcc)
|
||||||
SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_DIR}/arm-linux-gnueabihf/libc)
|
SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_DIR})
|
||||||
|
|
||||||
|
set(ENV{PKG_CONFIG_PATH} "${TOOLCHAIN_DIR}/sysroot//usr/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
|
||||||
|
set(CMAKE_SYSROOT ${TOOLCHAIN_DIR}/sysroot)
|
||||||
|
@ -3052,7 +3052,7 @@ bool View::draw(Canvas&canvas,ViewGroup*parent,long drawingTime){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Deal with alpha if it is or used to be <1
|
// Deal with alpha if it is or used to be <1
|
||||||
if (alpha < 1 || (mPrivateFlags3 & PFLAG3_VIEW_IS_ANIMATING_ALPHA) != 0) {
|
if (alpha < 1.f || (mPrivateFlags3 & PFLAG3_VIEW_IS_ANIMATING_ALPHA) != 0) {
|
||||||
if (alpha < 1) {
|
if (alpha < 1) {
|
||||||
mPrivateFlags3 |= PFLAG3_VIEW_IS_ANIMATING_ALPHA;
|
mPrivateFlags3 |= PFLAG3_VIEW_IS_ANIMATING_ALPHA;
|
||||||
} else {
|
} else {
|
||||||
@ -3079,7 +3079,7 @@ bool View::draw(Canvas&canvas,ViewGroup*parent,long drawingTime){
|
|||||||
|
|
||||||
if (!drawingWithRenderNode) {
|
if (!drawingWithRenderNode) {
|
||||||
// apply clips directly, since RenderNode won't do it for this draw
|
// apply clips directly, since RenderNode won't do it for this draw
|
||||||
int clips=0;
|
int clips = 0;
|
||||||
if ((parentFlags & ViewGroup::FLAG_CLIP_CHILDREN) != 0 && cache == nullptr) {
|
if ((parentFlags & ViewGroup::FLAG_CLIP_CHILDREN) != 0 && cache == nullptr) {
|
||||||
if (offsetForScroll){
|
if (offsetForScroll){
|
||||||
canvas.rectangle(sx,sy,getWidth(),getHeight());
|
canvas.rectangle(sx,sy,getWidth(),getHeight());
|
||||||
@ -3102,6 +3102,7 @@ bool View::draw(Canvas&canvas,ViewGroup*parent,long drawingTime){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!drawingWithDrawingCache) {
|
if (!drawingWithDrawingCache) {
|
||||||
|
if(alpha<1.0)canvas.push_group();
|
||||||
if (drawingWithRenderNode) {
|
if (drawingWithRenderNode) {
|
||||||
mPrivateFlags &= ~PFLAG_DIRTY_MASK;
|
mPrivateFlags &= ~PFLAG_DIRTY_MASK;
|
||||||
//((DisplayListCanvas) canvas).drawRenderNode(renderNode);
|
//((DisplayListCanvas) canvas).drawRenderNode(renderNode);
|
||||||
@ -3113,14 +3114,17 @@ bool View::draw(Canvas&canvas,ViewGroup*parent,long drawingTime){
|
|||||||
draw(canvas);
|
draw(canvas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(alpha<1.0){
|
||||||
|
canvas.pop_group_to_source();
|
||||||
|
canvas.paint_with_alpha(alpha);
|
||||||
|
}
|
||||||
} else if (cache != nullptr) {
|
} else if (cache != nullptr) {
|
||||||
mPrivateFlags &= ~PFLAG_DIRTY_MASK;
|
mPrivateFlags &= ~PFLAG_DIRTY_MASK;
|
||||||
cache->flush();
|
cache->flush();
|
||||||
canvas.save();
|
canvas.save();
|
||||||
canvas.reset_clip();
|
canvas.reset_clip();
|
||||||
canvas.set_source(cache,0,0);
|
canvas.set_source(cache,0,0);
|
||||||
if(alpha<1.f)canvas.paint_with_alpha(alpha);
|
canvas.paint_with_alpha(alpha);
|
||||||
else canvas.paint();
|
|
||||||
canvas.restore();
|
canvas.restore();
|
||||||
}
|
}
|
||||||
while(restoreTo-- >0) {
|
while(restoreTo-- >0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user