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

Side by Side Diff: ui/base/cursor/cursor_loader_ozone.cc

Issue 249303002: Revert of Use platform's device scale factor for cursor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
« no previous file with comments | « ui/base/cursor/cursor_loader.h ('k') | ui/base/cursor/cursor_loader_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/base/cursor/cursor_loader_ozone.h" 5 #include "ui/base/cursor/cursor_loader_ozone.h"
6 6
7 #include "ui/base/cursor/cursor.h" 7 #include "ui/base/cursor/cursor.h"
8 #include "ui/base/cursor/ozone/cursor_factory_ozone.h" 8 #include "ui/base/cursor/ozone/cursor_factory_ozone.h"
9 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/gfx/image/image_skia.h" 10 #include "ui/gfx/image/image_skia.h"
11 11
12 namespace ui { 12 namespace ui {
13 13
14 CursorLoaderOzone::CursorLoaderOzone() {} 14 CursorLoaderOzone::CursorLoaderOzone() {}
15 15
16 CursorLoaderOzone::~CursorLoaderOzone() {} 16 CursorLoaderOzone::~CursorLoaderOzone() {}
17 17
18 void CursorLoaderOzone::LoadImageCursor(int id, 18 void CursorLoaderOzone::LoadImageCursor(int id,
19 int resource_id, 19 int resource_id,
20 const gfx::Point& hot) { 20 const gfx::Point& hot) {
21 const gfx::ImageSkia* image = 21 const gfx::ImageSkia* image =
22 ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id); 22 ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id);
23 const gfx::ImageSkiaRep& image_rep = 23 const gfx::ImageSkiaRep& image_rep =
24 image->GetRepresentation(scale()); 24 image->GetRepresentation(display().device_scale_factor());
25 SkBitmap bitmap = image_rep.sk_bitmap(); 25 SkBitmap bitmap = image_rep.sk_bitmap();
26 cursors_[id] = 26 cursors_[id] =
27 CursorFactoryOzone::GetInstance()->CreateImageCursor(bitmap, hot); 27 CursorFactoryOzone::GetInstance()->CreateImageCursor(bitmap, hot);
28 } 28 }
29 29
30 void CursorLoaderOzone::LoadAnimatedCursor(int id, 30 void CursorLoaderOzone::LoadAnimatedCursor(int id,
31 int resource_id, 31 int resource_id,
32 const gfx::Point& hot, 32 const gfx::Point& hot,
33 int frame_delay_ms) { 33 int frame_delay_ms) {
34 // TODO(dnicoara) Add support: crbug.com/343245 34 // TODO(dnicoara) Add support: crbug.com/343245
(...skipping 24 matching lines...) Expand all
59 } 59 }
60 60
61 cursor->SetPlatformCursor(platform); 61 cursor->SetPlatformCursor(platform);
62 } 62 }
63 63
64 CursorLoader* CursorLoader::Create() { 64 CursorLoader* CursorLoader::Create() {
65 return new CursorLoaderOzone(); 65 return new CursorLoaderOzone();
66 } 66 }
67 67
68 } // namespace ui 68 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/cursor/cursor_loader.h ('k') | ui/base/cursor/cursor_loader_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698