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

Unified Diff: chrome/renderer/chrome_render_view_observer.cc

Issue 6987019: Revert 86625 - This change implements a first pass in the effort to remove the dependency of Plat... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/theme_helpers.cc ('k') | chrome/renderer/print_web_view_helper_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_render_view_observer.cc
===================================================================
--- chrome/renderer/chrome_render_view_observer.cc (revision 86628)
+++ chrome/renderer/chrome_render_view_observer.cc (working copy)
@@ -26,6 +26,7 @@
#include "content/renderer/content_renderer_client.h"
#include "googleurl/src/gurl.h"
#include "net/base/data_url.h"
+#include "skia/ext/bitmap_platform_device.h"
#include "skia/ext/image_operations.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCString.h"
@@ -594,9 +595,10 @@
if (!PaintViewIntoCanvas(view, canvas))
return false;
- SkDevice* device = skia::GetTopDevice(canvas);
+ skia::BitmapPlatformDevice& device =
+ static_cast<skia::BitmapPlatformDevice&>(canvas.getTopPlatformDevice());
- const SkBitmap& src_bmp = device->accessBitmap(false);
+ const SkBitmap& src_bmp = device.accessBitmap(false);
SkRect dest_rect = { 0, 0, SkIntToScalar(w), SkIntToScalar(h) };
float dest_aspect = dest_rect.width() / dest_rect.height();
@@ -631,7 +633,7 @@
score->at_top = (view->mainFrame()->scrollOffset().height == 0);
SkBitmap subset;
- device->accessBitmap(false).extractSubset(&subset, src_rect);
+ device.accessBitmap(false).extractSubset(&subset, src_rect);
// First do a fast downsample by powers of two to get close to the final size.
SkBitmap downsampled_subset =
@@ -657,9 +659,10 @@
if (!PaintViewIntoCanvas(view, canvas))
return false;
- SkDevice* device = skia::GetTopDevice(canvas);
+ skia::BitmapPlatformDevice& device =
+ static_cast<skia::BitmapPlatformDevice&>(canvas.getTopPlatformDevice());
- const SkBitmap& bitmap = device->accessBitmap(false);
+ const SkBitmap& bitmap = device.accessBitmap(false);
if (!bitmap.copyTo(snapshot, SkBitmap::kARGB_8888_Config))
return false;
« no previous file with comments | « chrome/browser/ui/views/theme_helpers.cc ('k') | chrome/renderer/print_web_view_helper_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698