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

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 11364133: Messages needed for webview compositor communication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Routed not control Created 8 years 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/browser_plugin/browser_plugin_guest.h" 5 #include "content/browser/browser_plugin/browser_plugin_guest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "content/browser/browser_plugin/browser_plugin_embedder.h" 10 #include "content/browser/browser_plugin/browser_plugin_embedder.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 const gfx::Point& relative_position) const { 328 const gfx::Point& relative_position) const {
329 gfx::Point screen_pos(relative_position); 329 gfx::Point screen_pos(relative_position);
330 screen_pos += guest_window_rect_.OffsetFromOrigin(); 330 screen_pos += guest_window_rect_.OffsetFromOrigin();
331 return screen_pos; 331 return screen_pos;
332 } 332 }
333 333
334 int BrowserPluginGuest::embedder_routing_id() const { 334 int BrowserPluginGuest::embedder_routing_id() const {
335 return embedder_web_contents_->GetRoutingID(); 335 return embedder_web_contents_->GetRoutingID();
336 } 336 }
337 337
338 void BrowserPluginGuest::SetCompositingBufferData(int gpu_process_id,
339 uint32 client_id,
340 uint32 context_id,
341 uint32 texture_id_0,
342 uint32 texture_id_1,
343 uint32 sync_point) {
344 // This is the signal for having no context
345 if (texture_id_0 == 0) {
346 DCHECK(texture_id_1 == 0);
347 return;
348 }
349
350 DCHECK(texture_id_1 != 0);
351 DCHECK(texture_id_0 != texture_id_1);
352
353 surface_handle_ = gfx::GLSurfaceHandle(gfx::kNullPluginWindow, true);
354 surface_handle_.parent_gpu_process_id = gpu_process_id;
355 surface_handle_.parent_client_id = client_id;
356 surface_handle_.parent_context_id = context_id;
357 surface_handle_.parent_texture_id[0] = texture_id_0;
358 surface_handle_.parent_texture_id[1] = texture_id_1;
359 surface_handle_.sync_point = sync_point;
360 }
361
338 bool BrowserPluginGuest::InAutoSizeBounds(const gfx::Size& size) const { 362 bool BrowserPluginGuest::InAutoSizeBounds(const gfx::Size& size) const {
339 return size.width() <= max_auto_size_.width() && 363 return size.width() <= max_auto_size_.width() &&
340 size.height() <= max_auto_size_.height(); 364 size.height() <= max_auto_size_.height();
341 } 365 }
342 366
343 void BrowserPluginGuest::UpdateRect( 367 void BrowserPluginGuest::UpdateRect(
344 RenderViewHost* render_view_host, 368 RenderViewHost* render_view_host,
345 const ViewHostMsg_UpdateRect_Params& params) { 369 const ViewHostMsg_UpdateRect_Params& params) {
346 // This handler is only of interest to us for the 2D software rendering path. 370 // This handler is only of interest to us for the 2D software rendering path.
347 // needs_ack should always be true for the 2D path. 371 // needs_ack should always be true for the 2D path.
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 default: 655 default:
632 break; 656 break;
633 } 657 }
634 } 658 }
635 659
636 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { 660 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) {
637 embedder_web_contents_->Send(msg); 661 embedder_web_contents_->Send(msg);
638 } 662 }
639 663
640 } // namespace content 664 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.h ('k') | content/common/browser_plugin_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698