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

Side by Side Diff: cc/draw_quad.cc

Issue 11192030: cc: Switch to Chromium DCHECKs LOGs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaseonenne Created 8 years, 2 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/direct_renderer.cc ('k') | cc/font_atlas.cc » ('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 "config.h" 5 #include "config.h"
6 #include "CCDrawQuad.h" 6 #include "CCDrawQuad.h"
7 7
8 #include "base/logging.h"
8 #include "CCCheckerboardDrawQuad.h" 9 #include "CCCheckerboardDrawQuad.h"
9 #include "CCDebugBorderDrawQuad.h" 10 #include "CCDebugBorderDrawQuad.h"
10 #include "CCIOSurfaceDrawQuad.h" 11 #include "CCIOSurfaceDrawQuad.h"
11 #include "CCRenderPassDrawQuad.h" 12 #include "CCRenderPassDrawQuad.h"
12 #include "CCSolidColorDrawQuad.h" 13 #include "CCSolidColorDrawQuad.h"
13 #include "CCStreamVideoDrawQuad.h" 14 #include "CCStreamVideoDrawQuad.h"
14 #include "CCTextureDrawQuad.h" 15 #include "CCTextureDrawQuad.h"
15 #include "CCTileDrawQuad.h" 16 #include "CCTileDrawQuad.h"
16 #include "CCYUVVideoDrawQuad.h" 17 #include "CCYUVVideoDrawQuad.h"
17 #include "IntRect.h" 18 #include "IntRect.h"
18 19
19 namespace cc { 20 namespace cc {
20 21
21 CCDrawQuad::CCDrawQuad(const CCSharedQuadState* sharedQuadState, Material materi al, const IntRect& quadRect) 22 CCDrawQuad::CCDrawQuad(const CCSharedQuadState* sharedQuadState, Material materi al, const IntRect& quadRect)
22 : m_sharedQuadState(sharedQuadState) 23 : m_sharedQuadState(sharedQuadState)
23 , m_sharedQuadStateId(sharedQuadState->id) 24 , m_sharedQuadStateId(sharedQuadState->id)
24 , m_material(material) 25 , m_material(material)
25 , m_quadRect(quadRect) 26 , m_quadRect(quadRect)
26 , m_quadVisibleRect(quadRect) 27 , m_quadVisibleRect(quadRect)
27 , m_quadOpaque(true) 28 , m_quadOpaque(true)
28 , m_needsBlending(false) 29 , m_needsBlending(false)
29 { 30 {
30 ASSERT(m_sharedQuadState); 31 DCHECK(m_sharedQuadState);
31 ASSERT(m_material != Invalid); 32 DCHECK(m_material != Invalid);
32 } 33 }
33 34
34 IntRect CCDrawQuad::opaqueRect() const 35 IntRect CCDrawQuad::opaqueRect() const
35 { 36 {
36 if (opacity() != 1) 37 if (opacity() != 1)
37 return IntRect(); 38 return IntRect();
38 if (m_sharedQuadState->opaque && m_quadOpaque) 39 if (m_sharedQuadState->opaque && m_quadOpaque)
39 return m_quadRect; 40 return m_quadRect;
40 return m_opaqueRect; 41 return m_opaqueRect;
41 } 42 }
(...skipping 30 matching lines...) Expand all
72 break; 73 break;
73 } 74 }
74 75
75 CRASH(); 76 CRASH();
76 return sizeof(CCDrawQuad); 77 return sizeof(CCDrawQuad);
77 } 78 }
78 79
79 scoped_ptr<CCDrawQuad> CCDrawQuad::copy(const CCSharedQuadState* copiedSharedQua dState) const 80 scoped_ptr<CCDrawQuad> CCDrawQuad::copy(const CCSharedQuadState* copiedSharedQua dState) const
80 { 81 {
81 // RenderPass quads have their own copy() method. 82 // RenderPass quads have their own copy() method.
82 ASSERT(material() != RenderPass); 83 DCHECK(material() != RenderPass);
83 84
84 unsigned bytes = size(); 85 unsigned bytes = size();
85 ASSERT(bytes); 86 DCHECK(bytes > 0);
86 87
87 scoped_ptr<CCDrawQuad> copyQuad(reinterpret_cast<CCDrawQuad*>(new char[bytes ])); 88 scoped_ptr<CCDrawQuad> copyQuad(reinterpret_cast<CCDrawQuad*>(new char[bytes ]));
88 memcpy(copyQuad.get(), this, bytes); 89 memcpy(copyQuad.get(), this, bytes);
89 copyQuad->setSharedQuadState(copiedSharedQuadState); 90 copyQuad->setSharedQuadState(copiedSharedQuadState);
90 91
91 return copyQuad.Pass(); 92 return copyQuad.Pass();
92 } 93 }
93 94
94 void CCDrawQuad::setSharedQuadState(const CCSharedQuadState* sharedQuadState) 95 void CCDrawQuad::setSharedQuadState(const CCSharedQuadState* sharedQuadState)
95 { 96 {
96 m_sharedQuadState = sharedQuadState; 97 m_sharedQuadState = sharedQuadState;
97 m_sharedQuadStateId = sharedQuadState->id; 98 m_sharedQuadStateId = sharedQuadState->id;
98 } 99 }
99 100
100 } 101 }
OLDNEW
« no previous file with comments | « cc/direct_renderer.cc ('k') | cc/font_atlas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698