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

Unified Diff: chrome/renderer/chrome_render_view_observer.cc

Issue 7019013: Removal of dependencies on PlatformDevice classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Syncing merge conflicts. 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 86706)
+++ chrome/renderer/chrome_render_view_observer.cc (working copy)
@@ -26,7 +26,6 @@
#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"
@@ -595,10 +594,9 @@
if (!PaintViewIntoCanvas(view, canvas))
return false;
- skia::BitmapPlatformDevice& device =
- static_cast<skia::BitmapPlatformDevice&>(canvas.getTopPlatformDevice());
+ SkDevice* device = skia::GetTopDevice(canvas);
- 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();
@@ -633,7 +631,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 =
@@ -659,10 +657,9 @@
if (!PaintViewIntoCanvas(view, canvas))
return false;
- skia::BitmapPlatformDevice& device =
- static_cast<skia::BitmapPlatformDevice&>(canvas.getTopPlatformDevice());
+ SkDevice* device = skia::GetTopDevice(canvas);
- 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