Changeset 70552 in webkit
- Timestamp:
- Oct 26, 2010 12:01:19 PM (13 years ago)
- Location:
- trunk/WebKit/chromium
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/chromium/ChangeLog
r70543 r70552 1 2010-10-22 Stephen White <senorblanco@chromium.org> 2 3 Reviewed by Kenneth Russell. 4 5 Implement copy-texture-to-parent-texture API for WebGraphicsContext3DDefaultImpl. 6 https://bugs.webkit.org/show_bug.cgi?id=48152 7 8 This allows the in-process implementation to do accelerated canvas and 9 accelerated compositing together. It requires some changes landed 10 in chromium 63528, so this patch also rolls chromium DEPS to 63722 11 (current LKGR). 12 13 Covered by fast/canvas/arc360.html, and many more when run with 14 --accelerated-compositing and --accelerated-2d-canvas. 15 16 * src/WebGraphicsContext3DDefaultImpl.cpp: 17 (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl): 18 Add member vars to save the currently-bound texture and for the 19 texture-to-texture FBO. 20 (WebKit::WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl): 21 Delete the texture-to-texture FBO on destruction. 22 23 (WebKit::WebGraphicsContext3DDefaultImpl::initialize): 24 Generate the texture-to-texture FBO. 25 (WebKit::WebGraphicsContext3DDefaultImpl::supportsCopyTextureToParentTextureCHROMIUM): 26 Check for support of the glGetTexLevelParameteriv function (required 27 for this implementation). 28 (WebKit::WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM): 29 Implement the extension: bind the FBO, bind the child texture, then 30 do a glCopyTexImage2D() into the parent texture. 31 (WebKit::WebGraphicsContext3DDefaultImpl::bindTexture): 32 Record the newly-bound texture in m_boundTexture. 33 * src/WebGraphicsContext3DDefaultImpl.h: 34 Add the two new member variables. 35 * src/WebViewImpl.cpp: 36 (WebKit::WebViewImpl::graphicsContext3D): 37 Make sure the graphics context is reshaped to the correct size on all 38 platforms. 39 1 40 2010-10-26 Alexey Marinichev <amarinichev@chromium.org> 2 41 -
trunk/WebKit/chromium/DEPS
r70273 r70552 33 33 vars = { 34 34 'chromium_svn': 'http://src.chromium.org/svn/trunk/src', 35 'chromium_rev': '63 439'35 'chromium_rev': '63722' 36 36 } 37 37 -
trunk/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
r70534 r70552 80 80 , m_multisampleColorBuffer(0) 81 81 , m_boundFBO(0) 82 , m_boundTexture(0) 83 , m_copyTextureToParentTextureFBO(0) 82 84 #ifdef FLIP_FRAMEBUFFER_VERTICALLY 83 85 , m_scanline(0) … … 104 106 } 105 107 glDeleteTextures(1, &m_texture); 108 glDeleteFramebuffersEXT(1, &m_copyTextureToParentTextureFBO); 106 109 #ifdef FLIP_FRAMEBUFFER_VERTICALLY 107 110 if (m_scanline) … … 173 176 return false; 174 177 } 178 179 glGenFramebuffersEXT(1, &m_copyTextureToParentTextureFBO); 175 180 176 181 m_initialized = true; … … 561 566 bool WebGraphicsContext3DDefaultImpl::supportsCopyTextureToParentTextureCHROMIUM() 562 567 { 563 // We don't claim support for this extension at this time 564 return false; 568 // This extension requires this desktopGL-only function (GLES2 doesn't 569 // support it), so check for its existence here. 570 return glGetTexLevelParameteriv; 565 571 } 566 572 567 573 void WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM(unsigned id, unsigned id2) 568 574 { 575 makeContextCurrent(); 576 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_copyTextureToParentTextureFBO); 577 glFramebufferTexture2DEXT(GL_FRAMEBUFFER, 578 GL_COLOR_ATTACHMENT0, 579 GL_TEXTURE_2D, 580 id, 581 0); // level 582 glBindTexture(GL_TEXTURE_2D, id2); 583 GLsizei width, height; 584 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width); 585 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height); 586 glCopyTexImage2D(GL_TEXTURE_2D, 587 0, // level 588 GL_RGBA, 589 0, 0, // x, y 590 width, 591 height, 592 0); // border 593 glBindTexture(GL_TEXTURE_2D, m_boundTexture); 594 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO); 569 595 } 570 596 … … 691 717 DELEGATE_TO_GL_2(bindRenderbuffer, BindRenderbufferEXT, unsigned long, WebGLId) 692 718 693 DELEGATE_TO_GL_2(bindTexture, BindTexture, unsigned long, WebGLId) 719 void WebGraphicsContext3DDefaultImpl::bindTexture(unsigned long target, WebGLId texture) 720 { 721 makeContextCurrent(); 722 glBindTexture(target, texture); 723 m_boundTexture = texture; 724 } 694 725 695 726 DELEGATE_TO_GL_4(blendColor, BlendColor, double, double, double, double) -
trunk/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
r68806 r70552 289 289 unsigned int m_boundFBO; 290 290 291 // For tracking which texture is bound 292 unsigned int m_boundTexture; 293 294 // FBO used for copying child texture to parent texture. 295 unsigned m_copyTextureToParentTextureFBO; 296 291 297 #ifdef FLIP_FRAMEBUFFER_VERTICALLY 292 298 unsigned char* m_scanline; -
trunk/WebKit/chromium/src/WebViewImpl.cpp
r70543 r70552 2524 2524 GraphicsContext3D::Attributes attributes; 2525 2525 m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(GraphicsContext3D::Attributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); 2526 #if OS(DARWIN)2527 2526 if (m_temporaryOnscreenGraphicsContext3D) 2528 2527 m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); 2529 #endif2530 2528 context = m_temporaryOnscreenGraphicsContext3D.get(); 2531 2529 }
Note: See TracChangeset
for help on using the changeset viewer.