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

Side by Side Diff: cc/trees/layer_tree_host_pixeltest_tiles.cc

Issue 2889653002: Remove cullRect() from PaintOpBuffer. (Closed)
Patch Set: movecullrect2 rebase-once-and-for-all Created 3 years, 7 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
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "cc/layers/content_layer_client.h" 7 #include "cc/layers/content_layer_client.h"
8 #include "cc/layers/picture_layer.h" 8 #include "cc/layers/picture_layer.h"
9 #include "cc/output/copy_output_request.h" 9 #include "cc/output/copy_output_request.h"
10 #include "cc/paint/display_item_list.h" 10 #include "cc/paint/display_item_list.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 explicit BlueYellowClient(const gfx::Size& size) 106 explicit BlueYellowClient(const gfx::Size& size)
107 : size_(size), blue_top_(true) {} 107 : size_(size), blue_top_(true) {}
108 108
109 gfx::Rect PaintableRegion() override { return gfx::Rect(size_); } 109 gfx::Rect PaintableRegion() override { return gfx::Rect(size_); }
110 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( 110 scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
111 PaintingControlSetting painting_status) override { 111 PaintingControlSetting painting_status) override {
112 auto display_list = make_scoped_refptr(new DisplayItemList); 112 auto display_list = make_scoped_refptr(new DisplayItemList);
113 113
114 PaintRecorder recorder; 114 PaintRecorder recorder;
115 PaintCanvas* canvas = 115 PaintCanvas* canvas =
116 recorder.beginRecording(gfx::RectToSkRect(gfx::Rect(size_))); 116 recorder.beginRecording(gfx::RectToSkRect(PaintableRegion()));
117 gfx::Rect top(0, 0, size_.width(), size_.height() / 2); 117 gfx::Rect top(0, 0, size_.width(), size_.height() / 2);
118 gfx::Rect bottom(0, size_.height() / 2, size_.width(), size_.height() / 2); 118 gfx::Rect bottom(0, size_.height() / 2, size_.width(), size_.height() / 2);
119 119
120 gfx::Rect blue_rect = blue_top_ ? top : bottom; 120 gfx::Rect blue_rect = blue_top_ ? top : bottom;
121 gfx::Rect yellow_rect = blue_top_ ? bottom : top; 121 gfx::Rect yellow_rect = blue_top_ ? bottom : top;
122 122
123 PaintFlags flags; 123 PaintFlags flags;
124 flags.setStyle(PaintFlags::kFill_Style); 124 flags.setStyle(PaintFlags::kFill_Style);
125 125
126 flags.setColor(SK_ColorBLUE); 126 flags.setColor(SK_ColorBLUE);
127 canvas->drawRect(gfx::RectToSkRect(blue_rect), flags); 127 canvas->drawRect(gfx::RectToSkRect(blue_rect), flags);
128 flags.setColor(SK_ColorYELLOW); 128 flags.setColor(SK_ColorYELLOW);
129 canvas->drawRect(gfx::RectToSkRect(yellow_rect), flags); 129 canvas->drawRect(gfx::RectToSkRect(yellow_rect), flags);
130 130
131 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( 131 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>(
132 PaintableRegion(), recorder.finishRecordingAsPicture()); 132 PaintableRegion(), recorder.finishRecordingAsPicture(),
133 gfx::RectToSkRect(PaintableRegion()));
133 display_list->Finalize(); 134 display_list->Finalize();
134 return display_list; 135 return display_list;
135 } 136 }
136 137
137 bool FillsBoundsCompletely() const override { return true; } 138 bool FillsBoundsCompletely() const override { return true; }
138 size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } 139 size_t GetApproximateUnsharedMemoryUsage() const override { return 0; }
139 140
140 void set_blue_top(bool b) { blue_top_ = b; } 141 void set_blue_top(bool b) { blue_top_ = b; }
141 142
142 private: 143 private:
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 FullRaster_SingleThread_GpuRaster) { 249 FullRaster_SingleThread_GpuRaster) {
249 RunRasterPixelTest( 250 RunRasterPixelTest(
250 false, FULL_GPU, picture_layer_, 251 false, FULL_GPU, picture_layer_,
251 base::FilePath(FILE_PATH_LITERAL("blue_yellow_flipped.png"))); 252 base::FilePath(FILE_PATH_LITERAL("blue_yellow_flipped.png")));
252 } 253 }
253 254
254 } // namespace 255 } // namespace
255 } // namespace cc 256 } // namespace cc
256 257
257 #endif // !defined(OS_ANDROID) 258 #endif // !defined(OS_ANDROID)
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_masks.cc ('k') | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698