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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 | 568 |
569 void WebGraphicsContext3DCommandBufferImpl::reshape(int width, int height) { | 569 void WebGraphicsContext3DCommandBufferImpl::reshape(int width, int height) { |
570 reshapeWithScaleFactor(width, height, 1.f); | 570 reshapeWithScaleFactor(width, height, 1.f); |
571 } | 571 } |
572 | 572 |
573 void WebGraphicsContext3DCommandBufferImpl::reshapeWithScaleFactor( | 573 void WebGraphicsContext3DCommandBufferImpl::reshapeWithScaleFactor( |
574 int width, int height, float scale_factor) { | 574 int width, int height, float scale_factor) { |
575 cached_width_ = width; | 575 cached_width_ = width; |
576 cached_height_ = height; | 576 cached_height_ = height; |
577 | 577 |
578 gl_->ResizeCHROMIUM(width, height); | 578 gl_->ResizeCHROMIUM(width, height, scale_factor); |
579 } | 579 } |
580 | 580 |
581 void WebGraphicsContext3DCommandBufferImpl::FlipVertically( | 581 void WebGraphicsContext3DCommandBufferImpl::FlipVertically( |
582 uint8* framebuffer, | 582 uint8* framebuffer, |
583 unsigned int width, | 583 unsigned int width, |
584 unsigned int height) { | 584 unsigned int height) { |
585 if (width == 0) | 585 if (width == 0) |
586 return; | 586 return; |
587 scanline_.resize(width * 4); | 587 scanline_.resize(width * 4); |
588 uint8* scanline = &scanline_[0]; | 588 uint8* scanline = &scanline_[0]; |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1739 | 1739 |
1740 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1740 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
1741 const std::string& message, int id) { | 1741 const std::string& message, int id) { |
1742 if (error_message_callback_) { | 1742 if (error_message_callback_) { |
1743 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1743 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
1744 error_message_callback_->onErrorMessage(str, id); | 1744 error_message_callback_->onErrorMessage(str, id); |
1745 } | 1745 } |
1746 } | 1746 } |
1747 | 1747 |
1748 } // namespace content | 1748 } // namespace content |
OLD | NEW |