Fix a type mismatch on Windows caused by r201738.
[chromium-blink-merge.git] / cc / quads / stream_video_draw_quad.cc
blob831304f1a0800a50a32aa94619cee717c6be0451
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
3 // found in the LICENSE file.
5 #include "cc/quads/stream_video_draw_quad.h"
7 #include "base/logging.h"
9 namespace cc {
11 StreamVideoDrawQuad::StreamVideoDrawQuad() : resource_id(0) {}
13 scoped_ptr<StreamVideoDrawQuad> StreamVideoDrawQuad::Create() {
14 return make_scoped_ptr(new StreamVideoDrawQuad);
17 void StreamVideoDrawQuad::SetNew(const SharedQuadState* shared_quad_state,
18 gfx::Rect rect,
19 gfx::Rect opaque_rect,
20 unsigned resource_id,
21 const gfx::Transform& matrix) {
22 gfx::Rect visible_rect = rect;
23 bool needs_blending = false;
24 DrawQuad::SetAll(shared_quad_state, DrawQuad::STREAM_VIDEO_CONTENT, rect,
25 opaque_rect, visible_rect, needs_blending);
26 this->resource_id = resource_id;
27 this->matrix = matrix;
30 void StreamVideoDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
31 gfx::Rect rect,
32 gfx::Rect opaque_rect,
33 gfx::Rect visible_rect,
34 bool needs_blending,
35 unsigned resource_id,
36 const gfx::Transform& matrix) {
37 DrawQuad::SetAll(shared_quad_state, DrawQuad::STREAM_VIDEO_CONTENT, rect,
38 opaque_rect, visible_rect, needs_blending);
39 this->resource_id = resource_id;
40 this->matrix = matrix;
43 void StreamVideoDrawQuad::IterateResources(
44 const ResourceIteratorCallback& callback) {
45 resource_id = callback.Run(resource_id);
48 const StreamVideoDrawQuad* StreamVideoDrawQuad::MaterialCast(
49 const DrawQuad* quad) {
50 DCHECK(quad->material == DrawQuad::STREAM_VIDEO_CONTENT);
51 return static_cast<const StreamVideoDrawQuad*>(quad);
54 } // namespace cc