mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-02 04:07:42 +08:00
rename env SCREENSIZE to SCREEN_SIZE
This commit is contained in:
parent
ec5f25f87e
commit
8f98e3abbd
@ -107,7 +107,7 @@ int main(int argc,const char*argv[]){
|
||||
rv->getLayoutManager()->requestSimpleAnimationsInNextLayout();
|
||||
for(int i=0;i<100;i++){
|
||||
adapter->add(std::string("string ")+std::to_string(i));
|
||||
adapter->notifyItemInserted(i);
|
||||
//adapter->notifyItemInserted(i);//Notice:call notifyItemInserted before layout will cause memleak.
|
||||
}
|
||||
decoration->setDrawable(new ColorDrawable(0xFFFF0000));
|
||||
rv->addItemDecoration(decoration);
|
||||
|
@ -59,7 +59,7 @@ int GraphDevice::init(){
|
||||
Cairo::RefPtr<Cairo::ImageSurface> img= nullptr;
|
||||
if(!mLogo.empty()){
|
||||
std::ifstream fs(mLogo.c_str());
|
||||
img = Cairo::ImageSurface::create_from_stream(fs);
|
||||
img = Cairo::ImageSurface::create_from_stream(fs);
|
||||
}
|
||||
GFXInit();
|
||||
|
||||
@ -71,13 +71,17 @@ int GraphDevice::init(){
|
||||
mPrimaryContext = new Canvas(surf);
|
||||
mRectBanner.set(0,0,400,40);
|
||||
|
||||
GFXCreateSurface(0,&logoSurface,mScreenWidth,mScreenHeight,mFormat,0);
|
||||
GFXLockSurface(logoSurface,(void**)&logoBuffer,&pitch);
|
||||
RefPtr<Surface>logoSurf = ImageSurface::create(logoBuffer,Surface::Format::ARGB32,mScreenWidth,mScreenHeight,pitch);
|
||||
RefPtr<Cairo::Context>logoContext=Cairo::Context::create(logoSurf);
|
||||
showLogo(logoContext.get(),img);
|
||||
GFXBlit(mPrimarySurface,0,0,logoSurface,nullptr);
|
||||
GFXDestroySurface(logoSurface);
|
||||
if(img){
|
||||
GFXCreateSurface(0,&logoSurface,mScreenWidth,mScreenHeight,mFormat,0);
|
||||
GFXLockSurface(logoSurface,(void**)&logoBuffer,&pitch);
|
||||
RefPtr<Surface>logoSurf = ImageSurface::create(logoBuffer,Surface::Format::ARGB32,mScreenWidth,mScreenHeight,pitch);
|
||||
RefPtr<Cairo::Context>logoContext=Cairo::Context::create(logoSurf);
|
||||
showLogo(logoContext.get(),img);
|
||||
GFXBlit(mPrimarySurface,0,0,logoSurface,nullptr);
|
||||
GFXDestroySurface(logoSurface);
|
||||
}else{
|
||||
showLogo(mPrimaryContext,img);
|
||||
}
|
||||
|
||||
mLastComposeTime = SystemClock::uptimeMillis();
|
||||
mComposing = 0;
|
||||
|
@ -163,7 +163,7 @@ std::shared_ptr<Drawable::ConstantState>DrawableWrapper::getConstantState(){
|
||||
int DrawableWrapper::getChangingConfigurations()const{
|
||||
return Drawable::getChangingConfigurations()
|
||||
| (mState != nullptr ? mState->getChangingConfigurations() : 0)
|
||||
| mDrawable->getChangingConfigurations();
|
||||
| (mDrawable&&mDrawable->getChangingConfigurations());
|
||||
}
|
||||
|
||||
void DrawableWrapper::invalidateDrawable(Drawable& who){
|
||||
|
@ -209,6 +209,7 @@ LayerDrawable::LayerDrawable():LayerDrawable(nullptr){
|
||||
|
||||
LayerDrawable::LayerDrawable(const std::vector<Drawable*>&drawables)
|
||||
:LayerDrawable(){
|
||||
mHotspotBounds.set(0,0,0,0);
|
||||
for(auto d:drawables){
|
||||
ChildDrawable*child=new ChildDrawable(0);
|
||||
child->mDrawable=d;
|
||||
|
@ -25,8 +25,10 @@ static GFXRect screenMargin= {0}; //{60,0,60,0};
|
||||
|
||||
#define SENDKEY(k,down) {InjectKey(EV_KEY,k,down);}
|
||||
#if 1
|
||||
#define SENDMOUSE(time,x,y) {InjectABS(time,EV_ABS,0,x);\
|
||||
InjectABS(time,EV_ABS,1,y);InjectABS(time,EV_SYN,SYN_REPORT,0);}
|
||||
#define SENDMOUSE(time,x,y) {\
|
||||
InjectABS(time,EV_ABS,ABS_X,x);\
|
||||
InjectABS(time,EV_ABS,ABS_Y,y);\
|
||||
InjectABS(time,EV_SYN,SYN_REPORT,0);}
|
||||
#else
|
||||
#define SENDMOUSE(time,x,y) {InjectREL(time,EV_REL,0,x);\
|
||||
InjectREL(time,EV_REL,1,y);InjectREL(time,EV_SYN,SYN_REPORT,0);}
|
||||
@ -136,7 +138,7 @@ INT GFXInit() {
|
||||
}
|
||||
|
||||
INT GFXGetDisplaySize(int dispid,UINT*width,UINT*height) {
|
||||
const char*env= getenv("SCREENSIZE");
|
||||
const char*env= getenv("SCREEN_SIZE");
|
||||
if(env==NULL) {
|
||||
*width=1280;//dispCfg.width;
|
||||
*height=720;//dispCfg.height;
|
||||
|
Loading…
Reference in New Issue
Block a user