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

Side by Side Diff: cc/playback/compositing_display_item.cc

Issue 2747273002: cc: Remove AsValue virtual from DisplayItem. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « cc/playback/compositing_display_item.h ('k') | cc/playback/display_item.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "cc/playback/compositing_display_item.h" 5 #include "cc/playback/compositing_display_item.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 paint.setBlendMode(xfermode_); 54 paint.setBlendMode(xfermode_);
55 paint.setAlpha(alpha_); 55 paint.setAlpha(alpha_);
56 paint.setColorFilter(color_filter_); 56 paint.setColorFilter(color_filter_);
57 const SkRect* bounds = has_bounds_ ? &bounds_ : nullptr; 57 const SkRect* bounds = has_bounds_ ? &bounds_ : nullptr;
58 if (lcd_text_requires_opaque_layer_) 58 if (lcd_text_requires_opaque_layer_)
59 canvas->saveLayer(bounds, &paint); 59 canvas->saveLayer(bounds, &paint);
60 else 60 else
61 canvas->saveLayerPreserveLCDTextRequests(bounds, &paint); 61 canvas->saveLayerPreserveLCDTextRequests(bounds, &paint);
62 } 62 }
63 63
64 void CompositingDisplayItem::AsValueInto(
65 const gfx::Rect& visual_rect,
66 base::trace_event::TracedValue* array) const {
67 std::string info = base::StringPrintf(
68 "CompositingDisplayItem alpha: %d, xfermode: %d, visualRect: [%s]",
69 alpha_, static_cast<int>(xfermode_), visual_rect.ToString().c_str());
70 if (has_bounds_) {
71 base::StringAppendF(
72 &info, ", bounds: [%f, %f, %f, %f]", static_cast<float>(bounds_.x()),
73 static_cast<float>(bounds_.y()), static_cast<float>(bounds_.width()),
74 static_cast<float>(bounds_.height()));
75 }
76 array->AppendString(info);
77 }
78
79 EndCompositingDisplayItem::EndCompositingDisplayItem() 64 EndCompositingDisplayItem::EndCompositingDisplayItem()
80 : DisplayItem(END_COMPOSITING) {} 65 : DisplayItem(END_COMPOSITING) {}
81 66
82 EndCompositingDisplayItem::~EndCompositingDisplayItem() { 67 EndCompositingDisplayItem::~EndCompositingDisplayItem() {
83 } 68 }
84 69
85 void EndCompositingDisplayItem::Raster( 70 void EndCompositingDisplayItem::Raster(
86 SkCanvas* canvas, 71 SkCanvas* canvas,
87 SkPicture::AbortCallback* callback) const { 72 SkPicture::AbortCallback* callback) const {
88 canvas->restore(); 73 canvas->restore();
89 } 74 }
90 75
91 void EndCompositingDisplayItem::AsValueInto(
92 const gfx::Rect& visual_rect,
93 base::trace_event::TracedValue* array) const {
94 array->AppendString(
95 base::StringPrintf("EndCompositingDisplayItem visualRect: [%s]",
96 visual_rect.ToString().c_str()));
97 }
98
99 } // namespace cc 76 } // namespace cc
OLDNEW
« no previous file with comments | « cc/playback/compositing_display_item.h ('k') | cc/playback/display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698