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

Side by Side Diff: cc/heads_up_display_layer_impl.cc

Issue 11411050: cc: Make the DrawQuad subclasses into struct-like classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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.cc ('k') | cc/io_surface_draw_quad.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 "cc/heads_up_display_layer_impl.h" 5 #include "cc/heads_up_display_layer_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "cc/debug_colors.h" 10 #include "cc/debug_colors.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 if (!m_hudTexture->id()) 88 if (!m_hudTexture->id())
89 return; 89 return;
90 90
91 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ uadState()); 91 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ uadState());
92 92
93 gfx::Rect quadRect(gfx::Point(), bounds()); 93 gfx::Rect quadRect(gfx::Point(), bounds());
94 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect()); 94 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect());
95 bool premultipliedAlpha = true; 95 bool premultipliedAlpha = true;
96 gfx::RectF uvRect(0, 0, 1, 1); 96 gfx::RectF uvRect(0, 0, 1, 1);
97 bool flipped = false; 97 bool flipped = false;
98 quadSink.append(TextureDrawQuad::create(sharedQuadState, quadRect, opaqueRec t, m_hudTexture->id(), premultipliedAlpha, uvRect, flipped).PassAs<DrawQuad>(), appendQuadsData); 98 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create();
99 quad->SetNew(sharedQuadState, quadRect, opaqueRect, m_hudTexture->id(), prem ultipliedAlpha, uvRect, flipped);
100 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
99 } 101 }
100 102
101 void HeadsUpDisplayLayerImpl::updateHudTexture(ResourceProvider* resourceProvide r) 103 void HeadsUpDisplayLayerImpl::updateHudTexture(ResourceProvider* resourceProvide r)
102 { 104 {
103 if (!m_hudTexture->id()) 105 if (!m_hudTexture->id())
104 return; 106 return;
105 107
106 SkISize canvasSize; 108 SkISize canvasSize;
107 if (m_hudCanvas) 109 if (m_hudCanvas)
108 canvasSize = m_hudCanvas->getDeviceSize(); 110 canvasSize = m_hudCanvas->getDeviceSize();
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 canvas->drawRect(skRect, paint); 373 canvas->drawRect(skRect, paint);
372 } 374 }
373 } 375 }
374 376
375 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const 377 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const
376 { 378 {
377 return "HeadsUpDisplayLayer"; 379 return "HeadsUpDisplayLayer";
378 } 380 }
379 381
380 } // namespace cc 382 } // namespace cc
OLDNEW
« no previous file with comments | « cc/gl_renderer.cc ('k') | cc/io_surface_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698