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

Side by Side Diff: ui/ozone/platform/dri/dri_window_delegate_impl.cc

Issue 771563003: use SkClipOps where we can, legacyClip where we need to rework Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « ui/gfx/canvas.cc ('k') | ui/views/bubble/bubble_border.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/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
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
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
OLDNEW
« no previous file with comments | « ui/gfx/canvas.cc ('k') | ui/views/bubble/bubble_border.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698