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

Side by Side Diff: cc/playback/compositing_display_item.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
« 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 "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/trace_event/trace_event_argument.h" 8 #include "base/trace_event/trace_event_argument.h"
9 #include "cc/proto/display_item.pb.h" 9 #include "cc/proto/display_item.pb.h"
10 #include "cc/proto/gfx_conversions.h" 10 #include "cc/proto/gfx_conversions.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 const gfx::Rect& canvas_target_playback_rect, 87 const gfx::Rect& canvas_target_playback_rect,
88 SkPicture::AbortCallback* callback) const { 88 SkPicture::AbortCallback* callback) const {
89 SkPaint paint; 89 SkPaint paint;
90 paint.setXfermodeMode(xfermode_); 90 paint.setXfermodeMode(xfermode_);
91 paint.setAlpha(alpha_); 91 paint.setAlpha(alpha_);
92 paint.setColorFilter(color_filter_.get()); 92 paint.setColorFilter(color_filter_.get());
93 canvas->saveLayer(has_bounds_ ? &bounds_ : nullptr, &paint); 93 canvas->saveLayer(has_bounds_ ? &bounds_ : nullptr, &paint);
94 } 94 }
95 95
96 void CompositingDisplayItem::AsValueInto( 96 void CompositingDisplayItem::AsValueInto(
97 const gfx::Rect& visual_rect,
97 base::trace_event::TracedValue* array) const { 98 base::trace_event::TracedValue* array) const {
98 array->AppendString(base::StringPrintf( 99 array->AppendString(base::StringPrintf(
99 "CompositingDisplayItem alpha: %d, xfermode: %d", alpha_, xfermode_)); 100 "CompositingDisplayItem alpha: %d, xfermode: %d, visualRect: [%s]",
101 alpha_, xfermode_, visual_rect.ToString().c_str()));
100 if (has_bounds_) 102 if (has_bounds_)
101 array->AppendString(base::StringPrintf( 103 array->AppendString(base::StringPrintf(
102 ", bounds: [%f, %f, %f, %f]", static_cast<float>(bounds_.x()), 104 ", bounds: [%f, %f, %f, %f]", static_cast<float>(bounds_.x()),
103 static_cast<float>(bounds_.y()), static_cast<float>(bounds_.width()), 105 static_cast<float>(bounds_.y()), static_cast<float>(bounds_.width()),
104 static_cast<float>(bounds_.height()))); 106 static_cast<float>(bounds_.height())));
105 } 107 }
106 108
107 EndCompositingDisplayItem::EndCompositingDisplayItem() { 109 EndCompositingDisplayItem::EndCompositingDisplayItem() {
108 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */, 110 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */,
109 0 /* external_memory_usage */); 111 0 /* external_memory_usage */);
(...skipping 11 matching lines...) Expand all
121 } 123 }
122 124
123 void EndCompositingDisplayItem::Raster( 125 void EndCompositingDisplayItem::Raster(
124 SkCanvas* canvas, 126 SkCanvas* canvas,
125 const gfx::Rect& canvas_target_playback_rect, 127 const gfx::Rect& canvas_target_playback_rect,
126 SkPicture::AbortCallback* callback) const { 128 SkPicture::AbortCallback* callback) const {
127 canvas->restore(); 129 canvas->restore();
128 } 130 }
129 131
130 void EndCompositingDisplayItem::AsValueInto( 132 void EndCompositingDisplayItem::AsValueInto(
133 const gfx::Rect& visual_rect,
131 base::trace_event::TracedValue* array) const { 134 base::trace_event::TracedValue* array) const {
132 array->AppendString("EndCompositingDisplayItem"); 135 array->AppendString(
136 base::StringPrintf("EndCompositingDisplayItem visualRect: [%s]",
137 visual_rect.ToString().c_str()));
133 } 138 }
134 139
135 } // namespace cc 140 } // 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