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

Side by Side Diff: cc/draw_quad.cc

Issue 11270042: Add non-member non-mutating methods for common gfx::Rect operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 1 month 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/software_renderer.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 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
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
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 }
OLDNEW
« no previous file with comments | « cc/direct_renderer.cc ('k') | cc/software_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698