| 
        
       | 
      
        
  
  Revert 168457 "WebGL: Transfer ownership of WebGraphicsContext3D..."
Caused assertion failures on debug GPU bots. See Issue 344393 for details.
> WebGL: Transfer ownership of WebGraphicsContext3D from WebGLRenderingContext to DrawingBuffer.
> 
> Currently, the lifecycle of DrawingBuffer is different from it of
> WebGraphicsContext3D, so there is so many checks if the context is valid.
> This complexity is not necessary because DrawingBuffer does not own any
> objects when the context is lost or impossible to be created.
> 
> To be clear the lifecycle, this CL makes DrawingBuffer take ownership of WebGraphicsContext3D.
> 
> The DrawingBuffer creation or resize can fail if the memory is not enough. This
> logic is preserved.
> In detail,
> 1. If it occurs during WebGLRenderingContext creation, we give up creating
> WebGLRenderingContext.
> 2. If it occurs during restoration of lost context, we will try again.
> 3. If it occurs during resizing DrawingBuffer, we slightly ignore, because we
> can reuse different size FBO in this case.
> 
> In addition, this CL fixes two bugs.
> 1. maybeRestoreContext() pretends to success to restore although creating FBO in
> DrawingBuffer fails. As mentioned earlier, we will try again.
> 2. WebGLRenderingContext calls DrawingBuffer::reset() twice during creation,
> because the constructor of DrawingBuffer internally calls reset().
> 
> BUG= 344393
> 
> Review URL:  https://codereview.chromium.org/163773007
TBR=dongseong.hwang@intel.com
Committed:  https://src.chromium.org/viewvc/blink?view=rev&revision=168481
   
  
  
  
    
  
  
    
       | 
      Unified diffs | 
      Side-by-side diffs | 
      Delta from patch set | 
      Stats (+423 lines, -385 lines) | 
      Patch | 
     
    
      
          | 
        M     | 
        
          
            trunk/Source/core/html/canvas/OESVertexArrayObject.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          3 chunks | 
          +5 lines, -5 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/core/html/canvas/WebGLBuffer.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +1 line, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/core/html/canvas/WebGLContextGroup.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +1 line, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        MM    | 
        
          
            trunk/Source/core/html/canvas/WebGLContextObject.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          2 chunks | 
          +3 lines, -3 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/core/html/canvas/WebGLDebugShaders.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +1 line, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/core/html/canvas/WebGLDrawBuffers.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          2 chunks | 
          +2 lines, -2 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/core/html/canvas/WebGLFramebuffer.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          5 chunks | 
          +5 lines, -5 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/core/html/canvas/WebGLProgram.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +1 line, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/core/html/canvas/WebGLRenderbuffer.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +1 line, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/core/html/canvas/WebGLRenderingContext.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +1 line, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/core/html/canvas/WebGLRenderingContextBase.h
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          5 chunks | 
          +6 lines, -4 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/core/html/canvas/WebGLRenderingContextBase.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          161 chunks | 
          +305 lines, -300 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/core/html/canvas/WebGLShader.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +1 line, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/core/html/canvas/WebGLTexture.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +1 line, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          5 chunks | 
          +6 lines, -6 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/platform/graphics/gpu/DrawingBuffer.h
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          3 chunks | 
          +10 lines, -6 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/platform/graphics/gpu/DrawingBuffer.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          19 chunks | 
          +59 lines, -41 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M     | 
        
          
            trunk/Source/web/tests/DrawingBufferTest.cpp
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          2 chunks | 
          +14 lines, -5 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
   
  
  
 
  
   
  
    
  
  
  
    
    Total messages: 2 (0 generated)
     
  
  
       |