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

Unified Diff: ui/base/cursor/cursor_loader_x11.cc

Issue 15896012: Use SkBitmapOperations to extract a frame of animation cursors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/cursor/cursor_loader_x11.cc
diff --git a/ui/base/cursor/cursor_loader_x11.cc b/ui/base/cursor/cursor_loader_x11.cc
index 7e693af79d5b9c3dca59d9eee7b9610f15e7fc31..8d9f36fe0fbde2d906d7ef38f6d045a3d426fdf2 100644
--- a/ui/base/cursor/cursor_loader_x11.cc
+++ b/ui/base/cursor/cursor_loader_x11.cc
@@ -232,16 +232,13 @@ void CursorLoaderX11::LoadAnimatedCursor(int id,
int x_offset = frame_width * frame;
DCHECK_LE(x_offset + frame_width, total_width);
- SkBitmap cropped;
- SkIRect rect = SkIRect::MakeXYWH(x_offset, 0, frame_width, frame_height);
- bitmap.extractSubset(&cropped, rect);
+ SkBitmap cropped = SkBitmapOperations::CreateTiledBitmap(
+ bitmap, x_offset, 0, frame_width, frame_height);
DCHECK_EQ(frame_width, cropped.width());
DCHECK_EQ(frame_height, cropped.height());
- if (scale() != 1.f)
- ScaleCursorImageAndHotpoint(scale(), &cropped, &hotpoint);
-
XcursorImage* x_image = SkBitmapToXcursorImage(&cropped, hotpoint);
+
x_image->delay = frame_delay_ms;
x_images->images[frame] = x_image;
}
« 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