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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 10826054: Convert the sub-rectangle for GL functions from the views coordinate to the OpenGL coordinate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/browser/renderer_host/render_widget_host_view_mac.h" 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h"
6 6
7 #include <QuartzCore/QuartzCore.h> 7 #include <QuartzCore/QuartzCore.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 if (!compositing_iosurface_.get() || 825 if (!compositing_iosurface_.get() ||
826 !compositing_iosurface_->HasIOSurface()) 826 !compositing_iosurface_->HasIOSurface())
827 return; 827 return;
828 828
829 float scale = ScaleFactor(cocoa_view_); 829 float scale = ScaleFactor(cocoa_view_);
830 gfx::Size dst_pixel_size = dst_size.Scale(scale); 830 gfx::Size dst_pixel_size = dst_size.Scale(scale);
831 if (!output->initialize( 831 if (!output->initialize(
832 dst_pixel_size.width(), dst_pixel_size.height(), true)) 832 dst_pixel_size.width(), dst_pixel_size.height(), true))
833 return; 833 return;
834 834
835 gfx::Rect src_pixel_subrect(src_subrect.origin().Scale(scale), 835 // Convert |src_subrect| from the views coordinate (upper-left origin) into
836 src_subrect.size().Scale(scale)); 836 // the OpenGL coordinate (lower-left origin).
837 gfx::Rect src_gl_subrect = src_subrect;
838 src_gl_subrect.set_y(
839 GetViewBounds().height() - src_subrect.y() - src_subrect.height());
Nico 2012/07/27 23:41:24 Same here.
mazda 2012/07/28 00:31:44 Done.
840
841 gfx::Rect src_pixel_subrect = src_gl_subrect.Scale(scale);
837 const bool result = compositing_iosurface_->CopyTo( 842 const bool result = compositing_iosurface_->CopyTo(
838 src_pixel_subrect, 843 src_pixel_subrect,
839 dst_pixel_size, 844 dst_pixel_size,
840 output->getTopDevice()->accessBitmap(true).getPixels()); 845 output->getTopDevice()->accessBitmap(true).getPixels());
841 scoped_callback_runner.Release(); 846 scoped_callback_runner.Release();
842 callback.Run(result); 847 callback.Run(result);
843 } 848 }
844 849
845 // Sets whether or not to accept first responder status. 850 // Sets whether or not to accept first responder status.
846 void RenderWidgetHostViewMac::SetTakesFocusOnlyOnMouseDown(bool flag) { 851 void RenderWidgetHostViewMac::SetTakesFocusOnlyOnMouseDown(bool flag) {
(...skipping 2365 matching lines...) Expand 10 before | Expand all | Expand 10 after
3212 if (!string) return NO; 3217 if (!string) return NO;
3213 3218
3214 // If the user is currently using an IME, confirm the IME input, 3219 // If the user is currently using an IME, confirm the IME input,
3215 // and then insert the text from the service, the same as TextEdit and Safari. 3220 // and then insert the text from the service, the same as TextEdit and Safari.
3216 [self confirmComposition]; 3221 [self confirmComposition];
3217 [self insertText:string]; 3222 [self insertText:string];
3218 return YES; 3223 return YES;
3219 } 3224 }
3220 3225
3221 @end 3226 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698