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

Side by Side Diff: content/plugin/webplugin_proxy.cc

Issue 11138024: Simplify platform_canvas.h by recognizing that PlatformCanvas does not actually extend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 "content/plugin/webplugin_proxy.h" 5 #include "content/plugin/webplugin_proxy.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 InvalidateRect(damaged_rect_); 475 InvalidateRect(damaged_rect_);
476 } 476 }
477 } 477 }
478 478
479 #if defined(OS_WIN) 479 #if defined(OS_WIN)
480 480
481 void WebPluginProxy::CreateCanvasFromHandle( 481 void WebPluginProxy::CreateCanvasFromHandle(
482 const TransportDIB::Handle& dib_handle, 482 const TransportDIB::Handle& dib_handle,
483 const gfx::Rect& window_rect, 483 const gfx::Rect& window_rect,
484 SkAutoTUnref<skia::PlatformCanvas>* canvas) { 484 SkAutoTUnref<skia::PlatformCanvas>* canvas) {
485 canvas->reset(new skia::PlatformCanvas); 485 canvas->reset(skia::CreatePlatformCanvas(window_rect.width(),
486 if (!canvas->get()->initialize( 486 window_rect.height(),
487 window_rect.width(), 487 true,
488 window_rect.height(), 488 dib_handle,
489 true, 489 skia::RETURN_NULL_ON_FAILURE));
490 dib_handle)) {
491 canvas->reset(NULL);
492 }
493 // The canvas does not own the section so we need to close it now. 490 // The canvas does not own the section so we need to close it now.
494 CloseHandle(dib_handle); 491 CloseHandle(dib_handle);
495 } 492 }
496 493
497 void WebPluginProxy::SetWindowlessBuffers( 494 void WebPluginProxy::SetWindowlessBuffers(
498 const TransportDIB::Handle& windowless_buffer0, 495 const TransportDIB::Handle& windowless_buffer0,
499 const TransportDIB::Handle& windowless_buffer1, 496 const TransportDIB::Handle& windowless_buffer1,
500 const TransportDIB::Handle& background_buffer, 497 const TransportDIB::Handle& background_buffer,
501 const gfx::Rect& window_rect) { 498 const gfx::Rect& window_rect) {
502 CreateCanvasFromHandle(windowless_buffer0, 499 CreateCanvasFromHandle(windowless_buffer0,
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 int input_type; 780 int input_type;
784 gfx::Rect caret_rect; 781 gfx::Rect caret_rect;
785 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) 782 if (!delegate_->GetIMEStatus(&input_type, &caret_rect))
786 return; 783 return;
787 784
788 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); 785 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect));
789 } 786 }
790 #endif 787 #endif
791 788
792 } // namespace content 789 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698