OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 5 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
6 | 6 |
7 #include "third_party/khronos/GLES2/gl2.h" | 7 #include "third_party/khronos/GLES2/gl2.h" |
8 #ifndef GL_GLEXT_PROTOTYPES | 8 #ifndef GL_GLEXT_PROTOTYPES |
9 #define GL_GLEXT_PROTOTYPES 1 | 9 #define GL_GLEXT_PROTOTYPES 1 |
10 #endif | 10 #endif |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 // (see above). | 560 // (see above). |
561 if (ShouldUseSwapClient()) | 561 if (ShouldUseSwapClient()) |
562 swap_client_->OnViewContextSwapBuffersPosted(); | 562 swap_client_->OnViewContextSwapBuffersPosted(); |
563 gl_->PostSubBufferCHROMIUM(x, y, width, height); | 563 gl_->PostSubBufferCHROMIUM(x, y, width, height); |
564 command_buffer_->Echo(base::Bind( | 564 command_buffer_->Echo(base::Bind( |
565 &WebGraphicsContext3DCommandBufferImpl::OnSwapBuffersComplete, | 565 &WebGraphicsContext3DCommandBufferImpl::OnSwapBuffersComplete, |
566 weak_ptr_factory_.GetWeakPtr())); | 566 weak_ptr_factory_.GetWeakPtr())); |
567 } | 567 } |
568 | 568 |
569 void WebGraphicsContext3DCommandBufferImpl::reshape(int width, int height) { | 569 void WebGraphicsContext3DCommandBufferImpl::reshape(int width, int height) { |
| 570 reshapeWithScaleFactor(width, height, 1.f); |
| 571 } |
| 572 |
| 573 void WebGraphicsContext3DCommandBufferImpl::reshapeWithScaleFactor( |
| 574 int width, int height, float scale_factor) { |
570 cached_width_ = width; | 575 cached_width_ = width; |
571 cached_height_ = height; | 576 cached_height_ = height; |
572 | 577 |
573 gl_->ResizeCHROMIUM(width, height); | 578 gl_->ResizeCHROMIUM(width, height); |
574 } | 579 } |
575 | 580 |
576 void WebGraphicsContext3DCommandBufferImpl::FlipVertically( | 581 void WebGraphicsContext3DCommandBufferImpl::FlipVertically( |
577 uint8* framebuffer, | 582 uint8* framebuffer, |
578 unsigned int width, | 583 unsigned int width, |
579 unsigned int height) { | 584 unsigned int height) { |
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1734 | 1739 |
1735 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1740 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
1736 const std::string& message, int id) { | 1741 const std::string& message, int id) { |
1737 if (error_message_callback_) { | 1742 if (error_message_callback_) { |
1738 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1743 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
1739 error_message_callback_->onErrorMessage(str, id); | 1744 error_message_callback_->onErrorMessage(str, id); |
1740 } | 1745 } |
1741 } | 1746 } |
1742 | 1747 |
1743 } // namespace content | 1748 } // namespace content |
OLD | NEW |