OLD | NEW |
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 | 6 |
7 #include "cc/draw_quad.h" | 7 #include "cc/draw_quad.h" |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "cc/checkerboard_draw_quad.h" | 10 #include "cc/checkerboard_draw_quad.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 { | 36 { |
37 if (opacity() != 1) | 37 if (opacity() != 1) |
38 return gfx::Rect(); | 38 return gfx::Rect(); |
39 if (m_sharedQuadState->opaque && m_quadOpaque) | 39 if (m_sharedQuadState->opaque && m_quadOpaque) |
40 return m_quadRect; | 40 return m_quadRect; |
41 return m_opaqueRect; | 41 return m_opaqueRect; |
42 } | 42 } |
43 | 43 |
44 void DrawQuad::setQuadVisibleRect(gfx::Rect quadVisibleRect) | 44 void DrawQuad::setQuadVisibleRect(gfx::Rect quadVisibleRect) |
45 { | 45 { |
46 m_quadVisibleRect = quadVisibleRect; | 46 m_quadVisibleRect = gfx::IntersectRects(quadVisibleRect, m_quadRect); |
47 m_quadVisibleRect.Intersect(m_quadRect); | |
48 } | 47 } |
49 | 48 |
50 unsigned DrawQuad::size() const | 49 unsigned DrawQuad::size() const |
51 { | 50 { |
52 switch (material()) { | 51 switch (material()) { |
53 case Checkerboard: | 52 case Checkerboard: |
54 return sizeof(CheckerboardDrawQuad); | 53 return sizeof(CheckerboardDrawQuad); |
55 case DebugBorder: | 54 case DebugBorder: |
56 return sizeof(DebugBorderDrawQuad); | 55 return sizeof(DebugBorderDrawQuad); |
57 case IOSurfaceContent: | 56 case IOSurfaceContent: |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 return copyQuad.Pass(); | 90 return copyQuad.Pass(); |
92 } | 91 } |
93 | 92 |
94 void DrawQuad::setSharedQuadState(const SharedQuadState* sharedQuadState) | 93 void DrawQuad::setSharedQuadState(const SharedQuadState* sharedQuadState) |
95 { | 94 { |
96 m_sharedQuadState = sharedQuadState; | 95 m_sharedQuadState = sharedQuadState; |
97 m_sharedQuadStateId = sharedQuadState->id; | 96 m_sharedQuadStateId = sharedQuadState->id; |
98 } | 97 } |
99 | 98 |
100 } | 99 } |
OLD | NEW |