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

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

Issue 2230513005: Move visual rect unioning between paired items to cc::DisplayItemList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review feedback. Created 4 years, 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "build/build_config.h" 7 #include "build/build_config.h"
8 #include "cc/layers/content_layer_client.h" 8 #include "cc/layers/content_layer_client.h"
9 #include "cc/layers/picture_image_layer.h" 9 #include "cc/layers/picture_image_layer.h"
10 #include "cc/layers/picture_layer.h" 10 #include "cc/layers/picture_layer.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 inset_rect.Inset(3, 3, 2, 2); 54 inset_rect.Inset(3, 3, 2, 2);
55 canvas->drawRect( 55 canvas->drawRect(
56 SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(), 56 SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(),
57 inset_rect.width(), inset_rect.height()), 57 inset_rect.width(), inset_rect.height()),
58 paint); 58 paint);
59 inset_rect.Inset(3, 3, 2, 2); 59 inset_rect.Inset(3, 3, 2, 2);
60 } 60 }
61 61
62 scoped_refptr<DisplayItemList> display_list = 62 scoped_refptr<DisplayItemList> display_list =
63 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); 63 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings());
64 display_list->CreateAndAppendItem<DrawingDisplayItem>( 64 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>(
65 PaintableRegion(), recorder.finishRecordingAsPicture()); 65 PaintableRegion(), recorder.finishRecordingAsPicture());
66 66
67 display_list->Finalize(); 67 display_list->Finalize();
68 return display_list; 68 return display_list;
69 } 69 }
70 70
71 private: 71 private:
72 gfx::Size bounds_; 72 gfx::Size bounds_;
73 }; 73 };
74 74
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 canvas->drawLine(i, 0, i, bounds_.height(), paint); 354 canvas->drawLine(i, 0, i, bounds_.height(), paint);
355 } 355 }
356 } else { 356 } else {
357 for (int i = 4; i < bounds_.height(); i += 16) { 357 for (int i = 4; i < bounds_.height(); i += 16) {
358 canvas->drawLine(0, i, bounds_.width(), i, paint); 358 canvas->drawLine(0, i, bounds_.width(), i, paint);
359 } 359 }
360 } 360 }
361 361
362 scoped_refptr<DisplayItemList> display_list = 362 scoped_refptr<DisplayItemList> display_list =
363 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); 363 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings());
364 display_list->CreateAndAppendItem<DrawingDisplayItem>( 364 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>(
365 PaintableRegion(), recorder.finishRecordingAsPicture()); 365 PaintableRegion(), recorder.finishRecordingAsPicture());
366 366
367 display_list->Finalize(); 367 display_list->Finalize();
368 return display_list; 368 return display_list;
369 } 369 }
370 370
371 private: 371 private:
372 gfx::Size bounds_; 372 gfx::Size bounds_;
373 SkColor color_; 373 SkColor color_;
374 bool vertical_; 374 bool vertical_;
(...skipping 17 matching lines...) Expand all
392 paint.setStyle(SkPaint::kFill_Style); 392 paint.setStyle(SkPaint::kFill_Style);
393 paint.setColor(SK_ColorWHITE); 393 paint.setColor(SK_ColorWHITE);
394 canvas->clear(SK_ColorTRANSPARENT); 394 canvas->clear(SK_ColorTRANSPARENT);
395 canvas->drawCircle(bounds_.width() / 2, 395 canvas->drawCircle(bounds_.width() / 2,
396 bounds_.height() / 2, 396 bounds_.height() / 2,
397 bounds_.width() / 4, 397 bounds_.width() / 4,
398 paint); 398 paint);
399 399
400 scoped_refptr<DisplayItemList> display_list = 400 scoped_refptr<DisplayItemList> display_list =
401 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); 401 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings());
402 display_list->CreateAndAppendItem<DrawingDisplayItem>( 402 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>(
403 PaintableRegion(), recorder.finishRecordingAsPicture()); 403 PaintableRegion(), recorder.finishRecordingAsPicture());
404 404
405 display_list->Finalize(); 405 display_list->Finalize();
406 return display_list; 406 return display_list;
407 } 407 }
408 408
409 private: 409 private:
410 gfx::Size bounds_; 410 gfx::Size bounds_;
411 }; 411 };
412 412
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 518
519 RunPixelResourceTest(background, 519 RunPixelResourceTest(background,
520 base::FilePath( 520 base::FilePath(
521 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); 521 FILE_PATH_LITERAL("mask_of_layer_with_blend.png")));
522 } 522 }
523 523
524 } // namespace 524 } // namespace
525 } // namespace cc 525 } // namespace cc
526 526
527 #endif // !defined(OS_ANDROID) 527 #endif // !defined(OS_ANDROID)
OLDNEW
« no previous file with comments | « cc/test/solid_color_content_layer_client.cc ('k') | cc/trees/layer_tree_host_pixeltest_tiles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698