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

Side by Side Diff: ui/compositor/clip_recorder.cc

Issue 2090203002: Remove antialiasing from views bounds rects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« cc/proto/display_item.proto ('K') | « cc/proto/display_item.proto ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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/compositor/clip_recorder.h" 5 #include "ui/compositor/clip_recorder.h"
6 6
7 #include "cc/playback/clip_display_item.h" 7 #include "cc/playback/clip_display_item.h"
8 #include "cc/playback/clip_path_display_item.h" 8 #include "cc/playback/clip_path_display_item.h"
9 #include "cc/playback/display_item_list.h" 9 #include "cc/playback/display_item_list.h"
10 #include "ui/compositor/paint_context.h" 10 #include "ui/compositor/paint_context.h"
(...skipping 29 matching lines...) Expand all
40 DCHECK_LT(num_closers_, kMaxOpCount); 40 DCHECK_LT(num_closers_, kMaxOpCount);
41 closers_[num_closers_] = closer; 41 closers_[num_closers_] = closer;
42 bounds_in_layer_[num_closers_++] = bounds_in_layer; 42 bounds_in_layer_[num_closers_++] = bounds_in_layer;
43 } 43 }
44 44
45 static gfx::Rect PathToEnclosingRect(const gfx::Path& path) { 45 static gfx::Rect PathToEnclosingRect(const gfx::Path& path) {
46 return gfx::ToEnclosingRect(gfx::SkRectToRectF(path.getBounds())); 46 return gfx::ToEnclosingRect(gfx::SkRectToRectF(path.getBounds()));
47 } 47 }
48 48
49 void ClipRecorder::ClipRect(const gfx::Rect& clip_rect) { 49 void ClipRecorder::ClipRect(const gfx::Rect& clip_rect) {
50 bool anti_alias = false;
danakj 2016/06/22 22:49:57 nit: antialias
Bret 2016/06/22 23:39:41 Changed everywhere in the file.
50 gfx::Rect clip_in_layer_space = context_.ToLayerSpaceRect(clip_rect); 51 gfx::Rect clip_in_layer_space = context_.ToLayerSpaceRect(clip_rect);
51 context_.list_->CreateAndAppendItem<cc::ClipDisplayItem>( 52 context_.list_->CreateAndAppendItem<cc::ClipDisplayItem>(
52 clip_in_layer_space, clip_rect, std::vector<SkRRect>()); 53 clip_in_layer_space, clip_rect, std::vector<SkRRect>(), anti_alias);
53 RecordCloser(clip_in_layer_space, CLIP_RECT); 54 RecordCloser(clip_in_layer_space, CLIP_RECT);
54 } 55 }
55 56
56 void ClipRecorder::ClipPath(const gfx::Path& clip_path) { 57 void ClipRecorder::ClipPath(const gfx::Path& clip_path) {
57 bool anti_alias = false; 58 bool anti_alias = false;
58 gfx::Rect clip_in_layer_space = 59 gfx::Rect clip_in_layer_space =
59 context_.ToLayerSpaceRect(PathToEnclosingRect(clip_path)); 60 context_.ToLayerSpaceRect(PathToEnclosingRect(clip_path));
60 context_.list_->CreateAndAppendItem<cc::ClipPathDisplayItem>( 61 context_.list_->CreateAndAppendItem<cc::ClipPathDisplayItem>(
61 clip_in_layer_space, clip_path, SkRegion::kIntersect_Op, anti_alias); 62 clip_in_layer_space, clip_path, SkRegion::kIntersect_Op, anti_alias);
62 RecordCloser(clip_in_layer_space, CLIP_PATH); 63 RecordCloser(clip_in_layer_space, CLIP_PATH);
63 } 64 }
64 65
65 void ClipRecorder::ClipPathWithAntiAliasing(const gfx::Path& clip_path) { 66 void ClipRecorder::ClipPathWithAntiAliasing(const gfx::Path& clip_path) {
66 bool anti_alias = true; 67 bool anti_alias = true;
67 gfx::Rect clip_in_layer_space = 68 gfx::Rect clip_in_layer_space =
68 context_.ToLayerSpaceRect(PathToEnclosingRect(clip_path)); 69 context_.ToLayerSpaceRect(PathToEnclosingRect(clip_path));
69 context_.list_->CreateAndAppendItem<cc::ClipPathDisplayItem>( 70 context_.list_->CreateAndAppendItem<cc::ClipPathDisplayItem>(
70 clip_in_layer_space, clip_path, SkRegion::kIntersect_Op, anti_alias); 71 clip_in_layer_space, clip_path, SkRegion::kIntersect_Op, anti_alias);
71 RecordCloser(clip_in_layer_space, CLIP_PATH); 72 RecordCloser(clip_in_layer_space, CLIP_PATH);
72 } 73 }
73 74
74 } // namespace ui 75 } // namespace ui
OLDNEW
« cc/proto/display_item.proto ('K') | « cc/proto/display_item.proto ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698