Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc

Issue 15688002: Part 1/3 (compositor) of adding with device scale factor to transport surfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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);
ccameron 2013/05/22 08:37:29 This is where we drop the scale factor on the floo
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) {
580 if (width == 0) 585 if (width == 0)
581 return; 586 return;
582 scanline_.resize(width * 4); 587 scanline_.resize(width * 4);
583 uint8* scanline = &scanline_[0]; 588 uint8* scanline = &scanline_[0];
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698