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

Side by Side Diff: cc/heads_up_display_layer_impl.cc

Issue 11570027: Adding support for per vertex opacity on textured layer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixing unittest Created 8 years 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
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 { 84 {
85 if (!m_hudTexture->id()) 85 if (!m_hudTexture->id())
86 return; 86 return;
87 87
88 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ uadState()); 88 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ uadState());
89 89
90 gfx::Rect quadRect(gfx::Point(), bounds()); 90 gfx::Rect quadRect(gfx::Point(), bounds());
91 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect()); 91 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect());
92 bool premultipliedAlpha = true; 92 bool premultipliedAlpha = true;
93 gfx::RectF uvRect(0, 0, 1, 1); 93 gfx::RectF uvRect(0, 0, 1, 1);
94 const float vertex_opacity[] = {1, 1, 1, 1};
whunt 2012/12/14 21:13:45 Just a note about 'const'. If you're worried you o
enne (OOO) 2012/12/14 21:21:05 I find const to be good for communicating expectat
94 bool flipped = false; 95 bool flipped = false;
95 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create(); 96 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create();
96 quad->SetNew(sharedQuadState, quadRect, opaqueRect, m_hudTexture->id(), prem ultipliedAlpha, uvRect, flipped); 97 quad->SetNew(sharedQuadState, quadRect, opaqueRect, m_hudTexture->id(), prem ultipliedAlpha, uvRect, vertex_opacity, flipped);
97 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData); 98 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
98 } 99 }
99 100
100 void HeadsUpDisplayLayerImpl::updateHudTexture(ResourceProvider* resourceProvide r) 101 void HeadsUpDisplayLayerImpl::updateHudTexture(ResourceProvider* resourceProvide r)
101 { 102 {
102 if (!m_hudTexture->id()) 103 if (!m_hudTexture->id())
103 return; 104 return;
104 105
105 SkISize canvasSize; 106 SkISize canvasSize;
106 if (m_hudCanvas) 107 if (m_hudCanvas)
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 376
376 canvas->restore(); 377 canvas->restore();
377 } 378 }
378 379
379 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const 380 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const
380 { 381 {
381 return "HeadsUpDisplayLayer"; 382 return "HeadsUpDisplayLayer";
382 } 383 }
383 384
384 } // namespace cc 385 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698