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

Side by Side Diff: cc/quads/texture_draw_quad.cc

Issue 380763002: Add builders for tracing event's structural arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed memory leak found by Linux ASAN Created 6 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 | Annotate | Revision Log
« no previous file with comments | « cc/quads/texture_draw_quad.h ('k') | cc/quads/tile_draw_quad.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 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/quads/texture_draw_quad.h" 5 #include "cc/quads/texture_draw_quad.h"
6 6
7 #include "base/debug/trace_event_argument.h"
7 #include "base/logging.h" 8 #include "base/logging.h"
8 #include "base/values.h" 9 #include "base/values.h"
9 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
10 #include "ui/gfx/vector2d_f.h" 11 #include "ui/gfx/vector2d_f.h"
11 12
12 namespace cc { 13 namespace cc {
13 14
14 TextureDrawQuad::TextureDrawQuad() 15 TextureDrawQuad::TextureDrawQuad()
15 : resource_id(0), 16 : resource_id(0),
16 premultiplied_alpha(false), 17 premultiplied_alpha(false),
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 void TextureDrawQuad::IterateResources( 77 void TextureDrawQuad::IterateResources(
77 const ResourceIteratorCallback& callback) { 78 const ResourceIteratorCallback& callback) {
78 resource_id = callback.Run(resource_id); 79 resource_id = callback.Run(resource_id);
79 } 80 }
80 81
81 const TextureDrawQuad* TextureDrawQuad::MaterialCast(const DrawQuad* quad) { 82 const TextureDrawQuad* TextureDrawQuad::MaterialCast(const DrawQuad* quad) {
82 DCHECK(quad->material == DrawQuad::TEXTURE_CONTENT); 83 DCHECK(quad->material == DrawQuad::TEXTURE_CONTENT);
83 return static_cast<const TextureDrawQuad*>(quad); 84 return static_cast<const TextureDrawQuad*>(quad);
84 } 85 }
85 86
86 void TextureDrawQuad::ExtendValue(base::DictionaryValue* value) const { 87 void TextureDrawQuad::ExtendValue(base::debug::TracedValue* value) const {
87 value->SetInteger("resource_id", resource_id); 88 value->SetInteger("resource_id", resource_id);
88 value->SetBoolean("premultiplied_alpha", premultiplied_alpha); 89 value->SetBoolean("premultiplied_alpha", premultiplied_alpha);
89 value->Set("uv_top_left", MathUtil::AsValue(uv_top_left).release()); 90 value->BeginArray("uv_top_left");
90 value->Set("uv_bottom_right", MathUtil::AsValue(uv_bottom_right).release()); 91 MathUtil::AddToTracedValue(uv_top_left, value);
92 value->EndArray();
93
94 value->BeginArray("uv_bottom_right");
95 MathUtil::AddToTracedValue(uv_bottom_right, value);
96 value->EndArray();
97
91 value->SetInteger("background_color", background_color); 98 value->SetInteger("background_color", background_color);
92 scoped_ptr<base::ListValue> vertex_opacity_value(new base::ListValue); 99
100 value->BeginArray("vertex_opacity");
93 for (size_t i = 0; i < 4; ++i) 101 for (size_t i = 0; i < 4; ++i)
94 vertex_opacity_value->AppendDouble(vertex_opacity[i]); 102 value->AppendDouble(vertex_opacity[i]);
95 value->Set("vertex_opacity", vertex_opacity_value.release()); 103 value->EndArray();
104
96 value->SetBoolean("flipped", flipped); 105 value->SetBoolean("flipped", flipped);
97 } 106 }
98 107
99 } // namespace cc 108 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quads/texture_draw_quad.h ('k') | cc/quads/tile_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698