[Password Generation] Breakout UMA stats for generated passwords
[chromium-blink-merge.git] / cc / quads / picture_draw_quad.cc
blobbf329c2a8c15bf00ccfdd70d9c831cbcaa16f935
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
3 // found in the LICENSE file.
5 #include "cc/quads/picture_draw_quad.h"
7 #include "base/debug/trace_event_argument.h"
8 #include "base/values.h"
9 #include "cc/base/math_util.h"
10 #include "cc/resources/platform_color.h"
12 namespace cc {
14 PictureDrawQuad::PictureDrawQuad() {
17 PictureDrawQuad::~PictureDrawQuad() {
20 void PictureDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
21 const gfx::Rect& rect,
22 const gfx::Rect& opaque_rect,
23 const gfx::Rect& visible_rect,
24 const gfx::RectF& tex_coord_rect,
25 const gfx::Size& texture_size,
26 ResourceFormat texture_format,
27 const gfx::Rect& content_rect,
28 float contents_scale,
29 scoped_refptr<RasterSource> raster_source) {
30 ContentDrawQuadBase::SetNew(
31 shared_quad_state,
32 DrawQuad::PICTURE_CONTENT,
33 rect,
34 opaque_rect,
35 visible_rect,
36 tex_coord_rect,
37 texture_size,
38 !PlatformColor::SameComponentOrder(texture_format));
39 this->content_rect = content_rect;
40 this->contents_scale = contents_scale;
41 this->raster_source = raster_source;
42 this->texture_format = texture_format;
45 void PictureDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
46 const gfx::Rect& rect,
47 const gfx::Rect& opaque_rect,
48 const gfx::Rect& visible_rect,
49 bool needs_blending,
50 const gfx::RectF& tex_coord_rect,
51 const gfx::Size& texture_size,
52 ResourceFormat texture_format,
53 const gfx::Rect& content_rect,
54 float contents_scale,
55 scoped_refptr<RasterSource> raster_source) {
56 ContentDrawQuadBase::SetAll(shared_quad_state,
57 DrawQuad::PICTURE_CONTENT,
58 rect,
59 opaque_rect,
60 visible_rect,
61 needs_blending,
62 tex_coord_rect,
63 texture_size,
64 !PlatformColor::SameComponentOrder(
65 texture_format));
66 this->content_rect = content_rect;
67 this->contents_scale = contents_scale;
68 this->raster_source = raster_source;
69 this->texture_format = texture_format;
72 void PictureDrawQuad::IterateResources(
73 const ResourceIteratorCallback& callback) {
74 // TODO(danakj): Convert to TextureDrawQuad?
75 NOTIMPLEMENTED();
78 const PictureDrawQuad* PictureDrawQuad::MaterialCast(const DrawQuad* quad) {
79 DCHECK(quad->material == DrawQuad::PICTURE_CONTENT);
80 return static_cast<const PictureDrawQuad*>(quad);
83 void PictureDrawQuad::ExtendValue(base::debug::TracedValue* value) const {
84 ContentDrawQuadBase::ExtendValue(value);
85 value->BeginArray("content_rect");
86 MathUtil::AddToTracedValue(content_rect, value);
87 value->EndArray();
88 value->SetDouble("contents_scale", contents_scale);
89 value->SetInteger("texture_format", texture_format);
90 // TODO(piman): raster_source?
93 } // namespace cc