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

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

Issue 2894843002: Revert of Remove cullRect() from PaintOpBuffer. (Closed)
Patch Set: rebase TestExpectations 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(PaintableRegion())); 116 recorder.beginRecording(gfx::RectToSkRect(gfx::Rect(size_)));
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()));
134 display_list->Finalize(); 133 display_list->Finalize();
135 return display_list; 134 return display_list;
136 } 135 }
137 136
138 bool FillsBoundsCompletely() const override { return true; } 137 bool FillsBoundsCompletely() const override { return true; }
139 size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } 138 size_t GetApproximateUnsharedMemoryUsage() const override { return 0; }
140 139
141 void set_blue_top(bool b) { blue_top_ = b; } 140 void set_blue_top(bool b) { blue_top_ = b; }
142 141
143 private: 142 private:
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 FullRaster_SingleThread_GpuRaster) { 248 FullRaster_SingleThread_GpuRaster) {
250 RunRasterPixelTest( 249 RunRasterPixelTest(
251 false, FULL_GPU, picture_layer_, 250 false, FULL_GPU, picture_layer_,
252 base::FilePath(FILE_PATH_LITERAL("blue_yellow_flipped.png"))); 251 base::FilePath(FILE_PATH_LITERAL("blue_yellow_flipped.png")));
253 } 252 }
254 253
255 } // namespace 254 } // namespace
256 } // namespace cc 255 } // namespace cc
257 256
258 #endif // !defined(OS_ANDROID) 257 #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