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

Side by Side Diff: cc/heads_up_display_layer_impl.cc

Issue 11783094: cc: Add point-based UV coordinate on TextureLayer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added unittest for clipped texture quad Created 7 years, 11 months 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 void HeadsUpDisplayLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& a ppendQuadsData) 90 void HeadsUpDisplayLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& a ppendQuadsData)
91 { 91 {
92 if (!m_hudTexture->id()) 92 if (!m_hudTexture->id())
93 return; 93 return;
94 94
95 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ uadState()); 95 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ uadState());
96 96
97 gfx::Rect quadRect(gfx::Point(), bounds()); 97 gfx::Rect quadRect(gfx::Point(), bounds());
98 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect()); 98 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect());
99 bool premultipliedAlpha = true; 99 bool premultipliedAlpha = true;
100 gfx::RectF uvRect(0, 0, 1, 1); 100 gfx::PointF uv_top_left(0, 0);
danakj 2013/01/15 01:48:42 nit: 0.f
Jerome 2013/01/15 17:58:12 Done.
101 gfx::PointF uv_bottom_right(1, 1);
danakj 2013/01/15 01:48:42 nit: 1.f
Jerome 2013/01/15 17:58:12 Done.
101 const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; 102 const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f};
102 bool flipped = false; 103 bool flipped = false;
103 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create(); 104 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create();
104 quad->SetNew(sharedQuadState, quadRect, opaqueRect, m_hudTexture->id(), prem ultipliedAlpha, uvRect, vertex_opacity, flipped); 105 quad->SetNew(sharedQuadState, quadRect, opaqueRect, m_hudTexture->id(), prem ultipliedAlpha, uv_top_left, uv_bottom_right, vertex_opacity, flipped);
105 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData); 106 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
106 } 107 }
107 108
108 void HeadsUpDisplayLayerImpl::updateHudTexture(ResourceProvider* resourceProvide r) 109 void HeadsUpDisplayLayerImpl::updateHudTexture(ResourceProvider* resourceProvide r)
109 { 110 {
110 if (!m_hudTexture->id()) 111 if (!m_hudTexture->id())
111 return; 112 return;
112 113
113 SkISize canvasSize; 114 SkISize canvasSize;
114 if (m_hudCanvas) 115 if (m_hudCanvas)
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 384
384 canvas->restore(); 385 canvas->restore();
385 } 386 }
386 387
387 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const 388 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const
388 { 389 {
389 return "HeadsUpDisplayLayer"; 390 return "HeadsUpDisplayLayer";
390 } 391 }
391 392
392 } // namespace cc 393 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698