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

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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 InvalidateRect(damaged_rect_); 474 InvalidateRect(damaged_rect_);
475 } 475 }
476 } 476 }
477 477
478 #if defined(OS_WIN) 478 #if defined(OS_WIN)
479 479
480 void WebPluginProxy::CreateCanvasFromHandle( 480 void WebPluginProxy::CreateCanvasFromHandle(
481 const TransportDIB::Handle& dib_handle, 481 const TransportDIB::Handle& dib_handle,
482 const gfx::Rect& window_rect, 482 const gfx::Rect& window_rect,
483 SkAutoTUnref<skia::PlatformCanvas>* canvas) { 483 SkAutoTUnref<skia::PlatformCanvas>* canvas) {
484 canvas->reset(new skia::PlatformCanvas); 484 canvas->reset(skia::CreatePlatformCanvas(window_rect.width(),
485 if (!canvas->get()->initialize( 485 window_rect.height(),
486 window_rect.width(), 486 true,
487 window_rect.height(), 487 dib_handle,
488 true, 488 skia::RETURN_NULL_ON_FAILURE));
489 dib_handle)) {
490 canvas->reset(NULL);
491 }
492 // The canvas does not own the section so we need to close it now. 489 // The canvas does not own the section so we need to close it now.
493 CloseHandle(dib_handle); 490 CloseHandle(dib_handle);
494 } 491 }
495 492
496 void WebPluginProxy::SetWindowlessBuffers( 493 void WebPluginProxy::SetWindowlessBuffers(
497 const TransportDIB::Handle& windowless_buffer0, 494 const TransportDIB::Handle& windowless_buffer0,
498 const TransportDIB::Handle& windowless_buffer1, 495 const TransportDIB::Handle& windowless_buffer1,
499 const TransportDIB::Handle& background_buffer, 496 const TransportDIB::Handle& background_buffer,
500 const gfx::Rect& window_rect) { 497 const gfx::Rect& window_rect) {
501 CreateCanvasFromHandle(windowless_buffer0, 498 CreateCanvasFromHandle(windowless_buffer0,
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 int input_type; 779 int input_type;
783 gfx::Rect caret_rect; 780 gfx::Rect caret_rect;
784 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) 781 if (!delegate_->GetIMEStatus(&input_type, &caret_rect))
785 return; 782 return;
786 783
787 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); 784 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect));
788 } 785 }
789 #endif 786 #endif
790 787
791 } // namespace content 788 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698