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

Side by Side Diff: cc/test/fake_content_layer_client.cc

Issue 1077033004: cc: Make DisplayItemList::Append replay into an SkPicture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 8 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/test/fake_content_layer_client.h" 5 #include "cc/test/fake_content_layer_client.h"
6 6
7 #include "cc/resources/clip_display_item.h" 7 #include "cc/resources/clip_display_item.h"
8 #include "cc/resources/drawing_display_item.h" 8 #include "cc/resources/drawing_display_item.h"
9 #include "cc/resources/transform_display_item.h" 9 #include "cc/resources/transform_display_item.h"
10 #include "third_party/skia/include/core/SkCanvas.h" 10 #include "third_party/skia/include/core/SkCanvas.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 } 72 }
73 73
74 scoped_refptr<DisplayItemList> 74 scoped_refptr<DisplayItemList>
75 FakeContentLayerClient::PaintContentsToDisplayList( 75 FakeContentLayerClient::PaintContentsToDisplayList(
76 const gfx::Rect& clip, 76 const gfx::Rect& clip,
77 PaintingControlSetting painting_control) { 77 PaintingControlSetting painting_control) {
78 SkPictureRecorder recorder; 78 SkPictureRecorder recorder;
79 skia::RefPtr<SkCanvas> canvas; 79 skia::RefPtr<SkCanvas> canvas;
80 skia::RefPtr<SkPicture> picture; 80 skia::RefPtr<SkPicture> picture;
81 scoped_refptr<DisplayItemList> list = DisplayItemList::Create(); 81 scoped_refptr<DisplayItemList> list = DisplayItemList::Create(clip);
82 list->AppendItem(ClipDisplayItem::Create(clip, std::vector<SkRRect>())); 82 list->AppendItem(ClipDisplayItem::Create(clip, std::vector<SkRRect>()));
83 83
84 for (RectPaintVector::const_iterator it = draw_rects_.begin(); 84 for (RectPaintVector::const_iterator it = draw_rects_.begin();
85 it != draw_rects_.end(); ++it) { 85 it != draw_rects_.end(); ++it) {
86 const gfx::RectF& draw_rect = it->first; 86 const gfx::RectF& draw_rect = it->first;
87 const SkPaint& paint = it->second; 87 const SkPaint& paint = it->second;
88 canvas = 88 canvas =
89 skia::SharePtr(recorder.beginRecording(gfx::RectFToSkRect(draw_rect))); 89 skia::SharePtr(recorder.beginRecording(gfx::RectFToSkRect(draw_rect)));
90 canvas->drawRectCoords(draw_rect.x(), draw_rect.y(), draw_rect.width(), 90 canvas->drawRectCoords(draw_rect.x(), draw_rect.y(), draw_rect.width(),
91 draw_rect.height(), paint); 91 draw_rect.height(), paint);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 } 123 }
124 } 124 }
125 125
126 list->AppendItem(EndClipDisplayItem::Create()); 126 list->AppendItem(EndClipDisplayItem::Create());
127 return list; 127 return list;
128 } 128 }
129 129
130 bool FakeContentLayerClient::FillsBoundsCompletely() const { return false; } 130 bool FakeContentLayerClient::FillsBoundsCompletely() const { return false; }
131 131
132 } // namespace cc 132 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698