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

Side by Side Diff: cc/heads_up_display_layer_impl.cc

Issue 11264056: cc: Use gfx:: Geometry types for positions, bounds, and related things. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ScaleAsVector 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/gl_renderer_unittest.cc ('k') | cc/image_layer.h » ('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/heads_up_display_layer_impl.h" 7 #include "cc/heads_up_display_layer_impl.h"
8 8
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "cc/debug_rect_history.h" 10 #include "cc/debug_rect_history.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 m_hudTexture->allocate(Renderer::ImplPool, bounds(), GL_RGBA, ResourcePr ovider::TextureUsageAny); 71 m_hudTexture->allocate(Renderer::ImplPool, bounds(), GL_RGBA, ResourcePr ovider::TextureUsageAny);
72 } 72 }
73 73
74 void HeadsUpDisplayLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& a ppendQuadsData) 74 void HeadsUpDisplayLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& a ppendQuadsData)
75 { 75 {
76 if (!m_hudTexture->id()) 76 if (!m_hudTexture->id())
77 return; 77 return;
78 78
79 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ uadState()); 79 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ uadState());
80 80
81 IntRect quadRect(IntPoint(), bounds()); 81 gfx::Rect quadRect(gfx::Point(), bounds());
82 bool premultipliedAlpha = true; 82 bool premultipliedAlpha = true;
83 FloatRect uvRect(0, 0, 1, 1); 83 gfx::RectF uvRect(0, 0, 1, 1);
84 bool flipped = false; 84 bool flipped = false;
85 quadSink.append(TextureDrawQuad::create(sharedQuadState, quadRect, m_hudText ure->id(), premultipliedAlpha, uvRect, flipped).PassAs<DrawQuad>(), appendQuadsD ata); 85 quadSink.append(TextureDrawQuad::create(sharedQuadState, quadRect, m_hudText ure->id(), premultipliedAlpha, uvRect, flipped).PassAs<DrawQuad>(), appendQuadsD ata);
86 } 86 }
87 87
88 void HeadsUpDisplayLayerImpl::updateHudTexture(ResourceProvider* resourceProvide r) 88 void HeadsUpDisplayLayerImpl::updateHudTexture(ResourceProvider* resourceProvide r)
89 { 89 {
90 if (!m_hudTexture->id()) 90 if (!m_hudTexture->id())
91 return; 91 return;
92 92
93 SkISize canvasSize; 93 SkISize canvasSize;
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 strokeColor = SkColorSetARGB(255, 100, 0, 200); 269 strokeColor = SkColorSetARGB(255, 100, 0, 200);
270 fillColor = SkColorSetARGB(10, 100, 0, 200); 270 fillColor = SkColorSetARGB(10, 100, 0, 200);
271 break; 271 break;
272 case OccludingRectType: 272 case OccludingRectType:
273 // Occluding rects in a reddish color. 273 // Occluding rects in a reddish color.
274 strokeColor = SkColorSetARGB(255, 200, 0, 100); 274 strokeColor = SkColorSetARGB(255, 200, 0, 100);
275 fillColor = SkColorSetARGB(10, 200, 0, 100); 275 fillColor = SkColorSetARGB(10, 200, 0, 100);
276 break; 276 break;
277 } 277 }
278 278
279 const FloatRect& rect = debugRects[i].rect; 279 const gfx::RectF& rect = debugRects[i].rect;
280 SkRect skRect = SkRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect. height()); 280 SkRect skRect = SkRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect. height());
281 SkPaint paint = createPaint(); 281 SkPaint paint = createPaint();
282 paint.setColor(fillColor); 282 paint.setColor(fillColor);
283 canvas->drawRect(skRect, paint); 283 canvas->drawRect(skRect, paint);
284 284
285 paint.setColor(strokeColor); 285 paint.setColor(strokeColor);
286 paint.setStyle(SkPaint::kStroke_Style); 286 paint.setStyle(SkPaint::kStroke_Style);
287 paint.setStrokeWidth(2); 287 paint.setStrokeWidth(2);
288 canvas->drawRect(skRect, paint); 288 canvas->drawRect(skRect, paint);
289 } 289 }
290 } 290 }
291 291
292 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const 292 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const
293 { 293 {
294 return "HeadsUpDisplayLayer"; 294 return "HeadsUpDisplayLayer";
295 } 295 }
296 296
297 } // namespace cc 297 } // namespace cc
OLDNEW
« no previous file with comments | « cc/gl_renderer_unittest.cc ('k') | cc/image_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698