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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 10905036: Pepper Flash Mac: Fix crash when playing video on MB retina (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: disable test on windows Created 8 years, 3 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
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/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 1394
1395 bool was_async = false; 1395 bool was_async = false;
1396 1396
1397 // If this is a GPU UpdateRect, params.bitmap is invalid and dib will be NULL. 1397 // If this is a GPU UpdateRect, params.bitmap is invalid and dib will be NULL.
1398 TransportDIB* dib = process_->GetTransportDIB(params.bitmap); 1398 TransportDIB* dib = process_->GetTransportDIB(params.bitmap);
1399 1399
1400 // If gpu process does painting, scroll_rect and copy_rects are always empty 1400 // If gpu process does painting, scroll_rect and copy_rects are always empty
1401 // and backing store is never used. 1401 // and backing store is never used.
1402 if (dib) { 1402 if (dib) {
1403 DCHECK(!params.bitmap_rect.IsEmpty()); 1403 DCHECK(!params.bitmap_rect.IsEmpty());
1404 const size_t size = params.bitmap_rect.height() * 1404 gfx::Size pixel_size = params.bitmap_rect.size().Scale(params.scale_factor);
1405 params.bitmap_rect.width() * 4; 1405 const size_t size = pixel_size.height() * pixel_size.width() * 4;
1406 if (dib->size() < size) { 1406 if (dib->size() < size) {
1407 DLOG(WARNING) << "Transport DIB too small for given rectangle"; 1407 DLOG(WARNING) << "Transport DIB too small for given rectangle";
1408 RecordAction(UserMetricsAction("BadMessageTerminate_RWH1")); 1408 RecordAction(UserMetricsAction("BadMessageTerminate_RWH1"));
1409 GetProcess()->ReceivedBadMessage(); 1409 GetProcess()->ReceivedBadMessage();
1410 } else { 1410 } else {
1411 UNSHIPPED_TRACE_EVENT_INSTANT2("test_latency", "UpdateRect", 1411 UNSHIPPED_TRACE_EVENT_INSTANT2("test_latency", "UpdateRect",
1412 "x+y", params.bitmap_rect.x() + params.bitmap_rect.y(), 1412 "x+y", params.bitmap_rect.x() + params.bitmap_rect.y(),
1413 "color", 0xffffff & *static_cast<uint32*>(dib->memory())); 1413 "color", 0xffffff & *static_cast<uint32*>(dib->memory()));
1414 UNSHIPPED_TRACE_EVENT_INSTANT1("test_latency", "UpdateRectWidth", 1414 UNSHIPPED_TRACE_EVENT_INSTANT1("test_latency", "UpdateRectWidth",
1415 "width", params.bitmap_rect.width()); 1415 "width", params.bitmap_rect.width());
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
2038 // indicate that no callback is in progress (i.e. without this line 2038 // indicate that no callback is in progress (i.e. without this line
2039 // DelayedAutoResized will not get called again). 2039 // DelayedAutoResized will not get called again).
2040 new_auto_size_.SetSize(0, 0); 2040 new_auto_size_.SetSize(0, 0);
2041 if (!should_auto_resize_) 2041 if (!should_auto_resize_)
2042 return; 2042 return;
2043 2043
2044 OnRenderAutoResized(new_size); 2044 OnRenderAutoResized(new_size);
2045 } 2045 }
2046 2046
2047 } // namespace content 2047 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/backing_store_mac.mm ('k') | content/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698