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

Unified Diff: ui/gfx/blit.cc

Issue 2593803004: simplify scrollcanvas to always use shared code (Closed)
Patch Set: just use DCHECK Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/blit.cc
diff --git a/ui/gfx/blit.cc b/ui/gfx/blit.cc
index 169eae25aafed3e92e67fe0956d4b61c724e1569..614f6c94e8475cfd40df60df9a11b19924c8b8c9 100644
--- a/ui/gfx/blit.cc
+++ b/ui/gfx/blit.cc
@@ -71,25 +71,10 @@ void ScrollCanvas(SkCanvas* canvas,
const gfx::Rect& in_clip,
const gfx::Vector2d& offset) {
DCHECK(!HasClipOrTransform(*canvas)); // Don't support special stuff.
-#if defined(OS_WIN)
- // If we have a PlatformCanvas, we should use ScrollDC. Otherwise, fall
- // through to the software implementation.
- if (skia::SupportsPlatformPaint(canvas)) {
- skia::ScopedPlatformPaint scoped_platform_paint(canvas);
- HDC hdc = scoped_platform_paint.GetNativeDrawingContext();
-
- RECT damaged_rect;
- RECT r = in_clip.ToRECT();
- ScrollDC(hdc, offset.x(), offset.y(), NULL, &r, NULL, &damaged_rect);
- return;
- }
-#endif // defined(OS_WIN)
- // For non-windows, always do scrolling in software.
- // Cairo has no nice scroll function so we do our own. On Mac it's possible to
- // use platform scroll code, but it's complex so we just use the same path
- // here. Either way it will be software-only, so it shouldn't matter much.
+
SkPixmap pixmap;
- skia::GetWritablePixels(canvas, &pixmap);
+ bool success = skia::GetWritablePixels(canvas, &pixmap);
+ DCHECK(success);
// We expect all coords to be inside the canvas, so clip here.
gfx::Rect clip = gfx::IntersectRects(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698