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

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

Issue 53106: We need to set the clipping region of the HDC passed in to a windowless flash... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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
« no previous file with comments | « no previous file | webkit/glue/plugins/test/npapi_test_plugin.vcproj » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/plugin/webplugin_proxy.h" 5 #include "chrome/plugin/webplugin_proxy.h"
6 6
7 #include "base/gfx/gdi_util.h" 7 #include "base/gfx/gdi_util.h"
8 #include "base/scoped_handle.h" 8 #include "base/scoped_handle.h"
9 #include "base/shared_memory.h" 9 #include "base/shared_memory.h"
10 #include "base/singleton.h" 10 #include "base/singleton.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 offset_rect.Offset(delegate_->GetRect().origin()); 315 offset_rect.Offset(delegate_->GetRect().origin());
316 if (!background_hdc_) { 316 if (!background_hdc_) {
317 FillRect(windowless_hdc_, &offset_rect.ToRECT(), 317 FillRect(windowless_hdc_, &offset_rect.ToRECT(),
318 static_cast<HBRUSH>(GetStockObject(BLACK_BRUSH))); 318 static_cast<HBRUSH>(GetStockObject(BLACK_BRUSH)));
319 } else { 319 } else {
320 BitBlt(windowless_hdc_, offset_rect.x(), offset_rect.y(), 320 BitBlt(windowless_hdc_, offset_rect.x(), offset_rect.y(),
321 offset_rect.width(), offset_rect.height(), background_hdc_, 321 offset_rect.width(), offset_rect.height(), background_hdc_,
322 rect.x(), rect.y(), SRCCOPY); 322 rect.x(), rect.y(), SRCCOPY);
323 } 323 }
324 324
325 RECT clip_rect = rect.ToRECT();
326 HRGN clip_region = CreateRectRgnIndirect(&clip_rect);
327 SelectClipRgn(windowless_hdc_, clip_region);
328
325 // Before we send the invalidate, paint so that renderer uses the updated 329 // Before we send the invalidate, paint so that renderer uses the updated
326 // bitmap. 330 // bitmap.
327 delegate_->Paint(windowless_hdc_, offset_rect); 331 delegate_->Paint(windowless_hdc_, offset_rect);
332
333 SelectClipRgn(windowless_hdc_, NULL);
334 DeleteObject(clip_region);
328 } 335 }
329 336
330 void WebPluginProxy::UpdateGeometry( 337 void WebPluginProxy::UpdateGeometry(
331 const gfx::Rect& window_rect, 338 const gfx::Rect& window_rect,
332 const gfx::Rect& clip_rect, 339 const gfx::Rect& clip_rect,
333 const base::SharedMemoryHandle& windowless_buffer, 340 const base::SharedMemoryHandle& windowless_buffer,
334 const base::SharedMemoryHandle& background_buffer) { 341 const base::SharedMemoryHandle& background_buffer) {
335 gfx::Rect old = delegate_->GetRect(); 342 gfx::Rect old = delegate_->GetRect();
336 gfx::Rect old_clip_rect = delegate_->GetClipRect(); 343 gfx::Rect old_clip_rect = delegate_->GetClipRect();
337 344
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 } 443 }
437 444
438 void WebPluginProxy::OnPaint(const gfx::Rect& damaged_rect) { 445 void WebPluginProxy::OnPaint(const gfx::Rect& damaged_rect) {
439 Paint(damaged_rect); 446 Paint(damaged_rect);
440 Send(new PluginHostMsg_InvalidateRect(route_id_, damaged_rect)); 447 Send(new PluginHostMsg_InvalidateRect(route_id_, damaged_rect));
441 } 448 }
442 449
443 bool WebPluginProxy::IsOffTheRecord() { 450 bool WebPluginProxy::IsOffTheRecord() {
444 return channel_->off_the_record(); 451 return channel_->off_the_record();
445 } 452 }
OLDNEW
« no previous file with comments | « no previous file | webkit/glue/plugins/test/npapi_test_plugin.vcproj » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698