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

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: inlines Created 8 years, 1 month 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 "webkit/plugins/ppapi/ppapi_plugin_instance.h" 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 1187
1188 // Don't do optimized painting if the area to paint intersects with the 1188 // Don't do optimized painting if the area to paint intersects with the
1189 // cut-out rects, otherwise we will paint over them. 1189 // cut-out rects, otherwise we will paint over them.
1190 for (std::vector<gfx::Rect>::const_iterator iter = cut_outs_rects_.begin(); 1190 for (std::vector<gfx::Rect>::const_iterator iter = cut_outs_rects_.begin();
1191 iter != cut_outs_rects_.end(); ++iter) { 1191 iter != cut_outs_rects_.end(); ++iter) {
1192 if (relative_paint_bounds.Intersects(*iter)) 1192 if (relative_paint_bounds.Intersects(*iter))
1193 return false; 1193 return false;
1194 } 1194 }
1195 1195
1196 *dib = image_data->PlatformImage()->GetTransportDIB(); 1196 *dib = image_data->PlatformImage()->GetTransportDIB();
1197 plugin_backing_store_rect.Offset(plugin_origin); 1197 plugin_backing_store_rect.Offset(plugin_origin.OffsetFromOrigin());
1198 *location = plugin_backing_store_rect; 1198 *location = plugin_backing_store_rect;
1199 clip_page.Offset(plugin_origin); 1199 clip_page.Offset(plugin_origin.OffsetFromOrigin());
1200 *clip = clip_page; 1200 *clip = clip_page;
1201 // The plugin scale factor is inverted, e.g. for a device scale factor of 2x 1201 // The plugin scale factor is inverted, e.g. for a device scale factor of 2x
1202 // the plugin scale factor is 0.5. 1202 // the plugin scale factor is 0.5.
1203 *scale_factor = 1.0 / scale; 1203 *scale_factor = 1.0 / scale;
1204 return true; 1204 return true;
1205 } 1205 }
1206 1206
1207 string16 PluginInstance::GetSelectedText(bool html) { 1207 string16 PluginInstance::GetSelectedText(bool html) {
1208 // Keep a reference on the stack. See NOTE above. 1208 // Keep a reference on the stack. See NOTE above.
1209 scoped_refptr<PluginInstance> ref(this); 1209 scoped_refptr<PluginInstance> ref(this);
(...skipping 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after
3228 screen_size_for_fullscreen_ = gfx::Size(); 3228 screen_size_for_fullscreen_ = gfx::Size();
3229 WebElement element = container_->element(); 3229 WebElement element = container_->element();
3230 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 3230 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
3231 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 3231 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
3232 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 3232 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
3233 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 3233 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
3234 } 3234 }
3235 3235
3236 } // namespace ppapi 3236 } // namespace ppapi
3237 } // namespace webkit 3237 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698