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/content_draw_quad_base.h"
7 #include "base/logging.h"
11 ContentDrawQuadBase::ContentDrawQuadBase()
12 : swizzle_contents(false) {
15 ContentDrawQuadBase::~ContentDrawQuadBase() {
18 void ContentDrawQuadBase::SetNew(const SharedQuadState
* shared_quad_state
,
19 DrawQuad::Material material
,
21 gfx::Rect opaque_rect
,
22 const gfx::RectF
& tex_coord_rect
,
23 gfx::Size texture_size
,
24 bool swizzle_contents
) {
25 gfx::Rect visible_rect
= rect
;
26 bool needs_blending
= false;
27 DrawQuad::SetAll(shared_quad_state
, material
, rect
, opaque_rect
,
28 visible_rect
, needs_blending
);
29 this->tex_coord_rect
= tex_coord_rect
;
30 this->texture_size
= texture_size
;
31 this->swizzle_contents
= swizzle_contents
;
34 void ContentDrawQuadBase::SetAll(const SharedQuadState
* shared_quad_state
,
35 DrawQuad::Material material
,
37 gfx::Rect opaque_rect
,
38 gfx::Rect visible_rect
,
40 const gfx::RectF
& tex_coord_rect
,
41 gfx::Size texture_size
,
42 bool swizzle_contents
) {
43 DrawQuad::SetAll(shared_quad_state
, material
, rect
, opaque_rect
,
44 visible_rect
, needs_blending
);
45 this->tex_coord_rect
= tex_coord_rect
;
46 this->texture_size
= texture_size
;
47 this->swizzle_contents
= swizzle_contents
;