OLD | NEW |
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/ozone/platform/dri/dri_window_delegate_impl.h" | 5 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
9 #include "third_party/skia/include/core/SkDevice.h" | 9 #include "third_party/skia/include/core/SkDevice.h" |
10 #include "third_party/skia/include/core/SkSurface.h" | 10 #include "third_party/skia/include/core/SkSurface.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 SkRect damage; | 28 SkRect damage; |
29 image.getBounds(&damage); | 29 image.getBounds(&damage); |
30 | 30 |
31 // Clear to transparent in case |image| is smaller than the canvas. | 31 // Clear to transparent in case |image| is smaller than the canvas. |
32 SkCanvas* canvas = cursor->GetCanvas(); | 32 SkCanvas* canvas = cursor->GetCanvas(); |
33 canvas->clear(SK_ColorTRANSPARENT); | 33 canvas->clear(SK_ColorTRANSPARENT); |
34 | 34 |
35 SkRect clip; | 35 SkRect clip; |
36 clip.set(0, 0, canvas->getDeviceSize().width(), | 36 clip.set(0, 0, canvas->getDeviceSize().width(), |
37 canvas->getDeviceSize().height()); | 37 canvas->getDeviceSize().height()); |
38 canvas->clipRect(clip, SkRegion::kReplace_Op); | 38 canvas->legacyClipRect(clip, SkRegion::kReplace_Op); |
39 canvas->drawBitmapRectToRect(image, &damage, damage); | 39 canvas->drawBitmapRectToRect(image, &damage, damage); |
40 } | 40 } |
41 | 41 |
42 } // namespace | 42 } // namespace |
43 | 43 |
44 DriWindowDelegateImpl::DriWindowDelegateImpl( | 44 DriWindowDelegateImpl::DriWindowDelegateImpl( |
45 gfx::AcceleratedWidget widget, | 45 gfx::AcceleratedWidget widget, |
46 DriWrapper* drm, | 46 DriWrapper* drm, |
47 DriWindowDelegateManager* window_manager, | 47 DriWindowDelegateManager* window_manager, |
48 ScreenManager* screen_manager) | 48 ScreenManager* screen_manager) |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 } | 149 } |
150 | 150 |
151 void DriWindowDelegateImpl::OnCursorAnimationTimeout() { | 151 void DriWindowDelegateImpl::OnCursorAnimationTimeout() { |
152 cursor_frame_++; | 152 cursor_frame_++; |
153 cursor_frame_ %= cursor_bitmaps_.size(); | 153 cursor_frame_ %= cursor_bitmaps_.size(); |
154 | 154 |
155 ResetCursor(true); | 155 ResetCursor(true); |
156 } | 156 } |
157 | 157 |
158 } // namespace ui | 158 } // namespace ui |
OLD | NEW |