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

Side by Side Diff: cc/resources/float_clip_display_item.cc

Issue 839143002: Roll Chrome into Mojo. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase 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 | « cc/resources/float_clip_display_item.h ('k') | cc/resources/gpu_rasterizer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/resources/float_clip_display_item.h"
6
7 #include "third_party/skia/include/core/SkCanvas.h"
8 #include "ui/gfx/skia_util.h"
9
10 namespace cc {
11
12 FloatClipDisplayItem::FloatClipDisplayItem(gfx::RectF clip_rect)
13 : clip_rect_(clip_rect) {
14 }
15
16 FloatClipDisplayItem::~FloatClipDisplayItem() {
17 }
18
19 void FloatClipDisplayItem::Raster(SkCanvas* canvas,
20 SkDrawPictureCallback* callback) const {
21 canvas->save();
22 canvas->clipRect(gfx::RectFToSkRect(clip_rect_));
23 }
24
25 bool FloatClipDisplayItem::IsSuitableForGpuRasterization() const {
26 return true;
27 }
28
29 int FloatClipDisplayItem::ApproximateOpCount() const {
30 return 1;
31 }
32
33 size_t FloatClipDisplayItem::PictureMemoryUsage() const {
34 return sizeof(gfx::RectF);
35 }
36
37 EndFloatClipDisplayItem::EndFloatClipDisplayItem() {
38 }
39
40 EndFloatClipDisplayItem::~EndFloatClipDisplayItem() {
41 }
42
43 void EndFloatClipDisplayItem::Raster(SkCanvas* canvas,
44 SkDrawPictureCallback* callback) const {
45 canvas->restore();
46 }
47
48 bool EndFloatClipDisplayItem::IsSuitableForGpuRasterization() const {
49 return true;
50 }
51
52 int EndFloatClipDisplayItem::ApproximateOpCount() const {
53 return 0;
54 }
55
56 size_t EndFloatClipDisplayItem::PictureMemoryUsage() const {
57 return 0;
58 }
59
60 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/float_clip_display_item.h ('k') | cc/resources/gpu_rasterizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698