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

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

Issue 1423653005: Further plumb visual rect into cc:DisplayItemList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix clip recorder params in omnibox. Created 5 years 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 "build/build_config.h" 5 #include "build/build_config.h"
6 #include "cc/layers/content_layer_client.h" 6 #include "cc/layers/content_layer_client.h"
7 #include "cc/layers/picture_image_layer.h" 7 #include "cc/layers/picture_image_layer.h"
8 #include "cc/layers/picture_layer.h" 8 #include "cc/layers/picture_layer.h"
9 #include "cc/layers/solid_color_layer.h" 9 #include "cc/layers/solid_color_layer.h"
10 #include "cc/playback/display_item_list_settings.h" 10 #include "cc/playback/display_item_list_settings.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 inset_rect.Inset(3, 3, 2, 2); 52 inset_rect.Inset(3, 3, 2, 2);
53 canvas->drawRect( 53 canvas->drawRect(
54 SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(), 54 SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(),
55 inset_rect.width(), inset_rect.height()), 55 inset_rect.width(), inset_rect.height()),
56 paint); 56 paint);
57 inset_rect.Inset(3, 3, 2, 2); 57 inset_rect.Inset(3, 3, 2, 2);
58 } 58 }
59 59
60 scoped_refptr<DisplayItemList> display_list = 60 scoped_refptr<DisplayItemList> display_list =
61 DisplayItemList::Create(clip, DisplayItemListSettings()); 61 DisplayItemList::Create(clip, DisplayItemListSettings());
62 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(); 62 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(clip);
63 63
64 skia::RefPtr<SkPicture> picture = 64 skia::RefPtr<SkPicture> picture =
65 skia::AdoptRef(recorder.endRecordingAsPicture()); 65 skia::AdoptRef(recorder.endRecordingAsPicture());
66 item->SetNew(std::move(picture)); 66 item->SetNew(std::move(picture));
67 67
68 display_list->Finalize(); 68 display_list->Finalize();
69 return display_list; 69 return display_list;
70 } 70 }
71 71
72 private: 72 private:
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 canvas->drawLine(i, 0, i, bounds_.height(), paint); 331 canvas->drawLine(i, 0, i, bounds_.height(), paint);
332 } 332 }
333 } else { 333 } else {
334 for (int i = 4; i < bounds_.height(); i += 16) { 334 for (int i = 4; i < bounds_.height(); i += 16) {
335 canvas->drawLine(0, i, bounds_.width(), i, paint); 335 canvas->drawLine(0, i, bounds_.width(), i, paint);
336 } 336 }
337 } 337 }
338 338
339 scoped_refptr<DisplayItemList> display_list = 339 scoped_refptr<DisplayItemList> display_list =
340 DisplayItemList::Create(clip, DisplayItemListSettings()); 340 DisplayItemList::Create(clip, DisplayItemListSettings());
341 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(); 341 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(clip);
342 342
343 skia::RefPtr<SkPicture> picture = 343 skia::RefPtr<SkPicture> picture =
344 skia::AdoptRef(recorder.endRecordingAsPicture()); 344 skia::AdoptRef(recorder.endRecordingAsPicture());
345 item->SetNew(std::move(picture)); 345 item->SetNew(std::move(picture));
346 346
347 display_list->Finalize(); 347 display_list->Finalize();
348 return display_list; 348 return display_list;
349 } 349 }
350 350
351 private: 351 private:
(...skipping 21 matching lines...) Expand all
373 paint.setStyle(SkPaint::kFill_Style); 373 paint.setStyle(SkPaint::kFill_Style);
374 paint.setColor(SK_ColorWHITE); 374 paint.setColor(SK_ColorWHITE);
375 canvas->clear(SK_ColorTRANSPARENT); 375 canvas->clear(SK_ColorTRANSPARENT);
376 canvas->drawCircle(bounds_.width() / 2, 376 canvas->drawCircle(bounds_.width() / 2,
377 bounds_.height() / 2, 377 bounds_.height() / 2,
378 bounds_.width() / 4, 378 bounds_.width() / 4,
379 paint); 379 paint);
380 380
381 scoped_refptr<DisplayItemList> display_list = 381 scoped_refptr<DisplayItemList> display_list =
382 DisplayItemList::Create(clip, DisplayItemListSettings()); 382 DisplayItemList::Create(clip, DisplayItemListSettings());
383 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(); 383 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(clip);
384 skia::RefPtr<SkPicture> picture = 384 skia::RefPtr<SkPicture> picture =
385 skia::AdoptRef(recorder.endRecordingAsPicture()); 385 skia::AdoptRef(recorder.endRecordingAsPicture());
386 item->SetNew(std::move(picture)); 386 item->SetNew(std::move(picture));
387 387
388 display_list->Finalize(); 388 display_list->Finalize();
389 return display_list; 389 return display_list;
390 } 390 }
391 391
392 private: 392 private:
393 gfx::Size bounds_; 393 gfx::Size bounds_;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 504
505 RunPixelResourceTest(background, 505 RunPixelResourceTest(background,
506 base::FilePath( 506 base::FilePath(
507 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); 507 FILE_PATH_LITERAL("mask_of_layer_with_blend.png")));
508 } 508 }
509 509
510 } // namespace 510 } // namespace
511 } // namespace cc 511 } // namespace cc
512 512
513 #endif // !defined(OS_ANDROID) 513 #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