Saved offscreen textures are allocated GL_RGB when no alpha channel is requested.
Saved offscreen textures are allocated GL_RGB when no alpha channel is requested.

There appears to also be problems in ANGLE which have not been addressed yet, specifically GL_RGB textures are allocated D3DFMT_A8R8G8B8 instead of D3DFMT_X8R8G8B8.

Prevent saved and target offscreen resources from being destroyed if we don't have a context.

TEST=try, run demos locally
BUG=61441

Review URL: http://codereview.chromium.org/4246001

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@64940 0039d316-1c4b-4281-b951-d872f2087c98

junmin-zhu/chromium-rivertrail,ltilve/chromium,ltilve/chromium,Chilledheart/chromium,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,junmin-zhu/chromium-rivertrail,PeterWangIntel/chromium-crosswalk,littlstar/chromium.src,fujunwei/chromium-crosswalk,dushu1203/chromium.src,anirudhSK/chromium,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,ondra-novak/chromium.src,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,dushu1203/chromium.src,nacl-webkit/chrome_deps,patrickm/chromium.src,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Just-D/chromium-1,anirudhSK/chromium,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,hujiajie/pa-chromium,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,chuan9/chromium-crosswalk,nacl-webkit/chrome_deps,chuan9/chromium-crosswalk,Chilledheart/chromium,nacl-webkit/chrome_deps,markYoungH/chromium.src,robclark/chromium,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk-efl,keishi/chromium,nacl-webkit/chrome_deps,Fireblend/chromium-crosswalk,Jonekee/chromium.src,rogerwang/chromium,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,ChromiumWebApps/chromium,robclark/chromium,fujunwei/chromium-crosswalk,keishi/chromium,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,hgl888/chromium-crosswalk,ondra-novak/chromium.src,axinging/chromium-crosswalk,ChromiumWebApps/chromium,keishi/chromium,markYoungH/chromium.src,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,rogerwang/chromium,littlstar/chromium.src,jaruba/chromium.src,axinging/chromium-crosswalk,Just-D/chromium-1,M4sse/chromium.src,junmin-zhu/chromium-rivertrail,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,krieger-od/nwjs_chromium.src,keishi/chromium,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,rogerwang/chromium,hujiajie/pa-chromium,dushu1203/chromium.src,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,rogerwang/chromium,dushu1203/chromium.src,ChromiumWebApps/chromium,hujiajie/pa-chromium,markYoungH/chromium.src,dushu1203/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,bright-sparks/chromium-spacewalk,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,anirudhSK/chromium,ondra-novak/chromium.src,jaruba/chromium.src,ltilve/chromium,Fireblend/chromium-crosswalk,dednal/chromium.src,junmin-zhu/chromium-rivertrail,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,markYoungH/chromium.src,Jonekee/chromium.src,keishi/chromium,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,timopulkkinen/BubbleFish,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,hujiajie/pa-chromium,ondra-novak/chromium.src,Just-D/chromium-1,robclark/chromium,rogerwang/chromium,axinging/chromium-crosswalk,jaruba/chromium.src,krieger-od/nwjs_chromium.src,patrickm/chromium.src,robclark/chromium,bright-sparks/chromium-spacewalk,timopulkkinen/BubbleFish,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,rogerwang/chromium,dednal/chromium.src,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,zcbenz/cefode-chromium,keishi/chromium,dednal/chromium.src,hujiajie/pa-chromium,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,dushu1203/chromium.src,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,anirudhSK/chromium,hgl888/chromium-crosswalk,keishi/chromium,bright-sparks/chromium-spacewalk,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,robclark/chromium,Just-D/chromium-1,mogoweb/chromium-crosswalk,anirudhSK/chromium,dednal/chromium.src,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,zcbenz/cefode-chromium,ltilve/chromium,ondra-novak/chromium.src,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,timopulkkinen/BubbleFish,M4sse/chromium.src,ltilve/chromium,M4sse/chromium.src,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,axinging/chromium-crosswalk,zcbenz/cefode-chromium,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,bright-sparks/chromium-spacewalk,timopulkkinen/BubbleFish,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,axinging/chromium-crosswalk,jaruba/chromium.src,dushu1203/chromium.src,keishi/chromium,junmin-zhu/chromium-rivertrail,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,Just-D/chromium-1,Just-D/chromium-1,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,timopulkkinen/BubbleFish,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,keishi/chromium,dednal/chromium.src,Just-D/chromium-1,jaruba/chromium.src,littlstar/chromium.src,ChromiumWebApps/chromium,ChromiumWebApps/chromium,Chilledheart/chromium,hujiajie/pa-chromium,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,Pluto-tv/chromium-crosswalk,dednal/chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,patrickm/chromium.src,markYoungH/chromium.src,dednal/chromium.src,zcbenz/cefode-chromium,ChromiumWebApps/chromium,anirudhSK/chromium,rogerwang/chromium,ltilve/chromium,markYoungH/chromium.src,robclark/chromium,Pluto-tv/chromium-crosswalk,patrickm/chromium.src,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,rogerwang/chromium,ChromiumWebApps/chromium,zcbenz/cefode-chromium,Fireblend/chromium-crosswalk,timopulkkinen/BubbleFish,chuan9/chromium-crosswalk,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,littlstar/chromium.src,zcbenz/cefode-chromium,jaruba/chromium.src,ltilve/chromium,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,robclark/chromium,mogoweb/chromium-crosswalk,ondra-novak/chromium.src,keishi/chromium,littlstar/chromium.src,Chilledheart/chromium,Jonekee/chromium.src,Fireblend/chromium-crosswalk,anirudhSK/chromium,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,rogerwang/chromium,markYoungH/chromium.src,robclark/chromium,dednal/chromium.src,Jonekee/chromium.src,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,robclark/chromium,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,fujunwei/chromium-crosswalk,ltilve/chromium,hgl888/chromium-crosswalk,anirudhSK/chromium,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,zcbenz/cefode-chromium,Jonekee/chromium.src,timopulkkinen/BubbleFish,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,ondra-novak/chromium.src,dushu1203/chromium.src,Chilledheart/chromium,dednal/chromium.src,ltilve/chromium,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,Just-D/chromium-1,mogoweb/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,littlstar/chromium.src,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,mogoweb/chromium-crosswalk,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,zcbenz/cefode-chromium,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,patrickm/chromium.src,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,keishi/chromium,Jonekee/chromium.src,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,nacl-webkit/chrome_deps,rogerwang/chromium,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,anirudhSK/chromium,junmin-zhu/chromium-rivertrail,robclark/chromium,M4sse/chromium.src