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

Side by Side Diff: cc/render_surface_impl.cc

Issue 11529003: [cc] Route LayerImpl::layerTreeHostImpl() calls through LayerTreeImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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
« no previous file with comments | « cc/quad_culler.cc ('k') | cc/tiled_layer_impl.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/render_surface_impl.h" 5 #include "cc/render_surface_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 { 196 {
197 DCHECK(!forReplica || m_owningLayer->hasReplica()); 197 DCHECK(!forReplica || m_owningLayer->hasReplica());
198 198
199 gfx::Rect clippedRectInTarget = computeClippedRectInTarget(m_owningLayer); 199 gfx::Rect clippedRectInTarget = computeClippedRectInTarget(m_owningLayer);
200 const gfx::Transform& drawTransform = forReplica ? m_replicaDrawTransform : m_drawTransform; 200 const gfx::Transform& drawTransform = forReplica ? m_replicaDrawTransform : m_drawTransform;
201 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(SharedQuadSta te::Create()); 201 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(SharedQuadSta te::Create());
202 sharedQuadState->SetAll(drawTransform, m_contentRect, clippedRectInTarget, m _clipRect, m_isClipped, m_drawOpacity); 202 sharedQuadState->SetAll(drawTransform, m_contentRect, clippedRectInTarget, m _clipRect, m_isClipped, m_drawOpacity);
203 203
204 if (m_owningLayer->showDebugBorders()) { 204 if (m_owningLayer->showDebugBorders()) {
205 SkColor color = forReplica ? DebugColors::SurfaceReplicaBorderColor() : DebugColors::SurfaceBorderColor(); 205 SkColor color = forReplica ? DebugColors::SurfaceReplicaBorderColor() : DebugColors::SurfaceBorderColor();
206 float width = forReplica ? DebugColors::SurfaceReplicaBorderWidth(m_owni ngLayer->layerTreeHostImpl()) : DebugColors::SurfaceBorderWidth(m_owningLayer->l ayerTreeHostImpl()); 206 float width = forReplica ? DebugColors::SurfaceReplicaBorderWidth(m_owni ngLayer->layerTreeImpl()) : DebugColors::SurfaceBorderWidth(m_owningLayer->layer TreeImpl());
207 scoped_ptr<DebugBorderDrawQuad> debugBorderQuad = DebugBorderDrawQuad::C reate(); 207 scoped_ptr<DebugBorderDrawQuad> debugBorderQuad = DebugBorderDrawQuad::C reate();
208 debugBorderQuad->SetNew(sharedQuadState, contentRect(), color, width); 208 debugBorderQuad->SetNew(sharedQuadState, contentRect(), color, width);
209 quadSink.append(debugBorderQuad.PassAs<DrawQuad>(), appendQuadsData); 209 quadSink.append(debugBorderQuad.PassAs<DrawQuad>(), appendQuadsData);
210 } 210 }
211 211
212 // FIXME: By using the same RenderSurfaceImpl for both the content and its r eflection, 212 // FIXME: By using the same RenderSurfaceImpl for both the content and its r eflection,
213 // it's currently not possible to apply a separate mask to the reflection la yer 213 // it's currently not possible to apply a separate mask to the reflection la yer
214 // or correctly handle opacity in reflections (opacity must be applied after drawing 214 // or correctly handle opacity in reflections (opacity must be applied after drawing
215 // both the layer and its reflection). The solution is to introduce yet anot her RenderSurfaceImpl 215 // both the layer and its reflection). The solution is to introduce yet anot her RenderSurfaceImpl
216 // to draw the layer and its reflection in. For now we only apply a separate reflection 216 // to draw the layer and its reflection in. For now we only apply a separate reflection
(...skipping 22 matching lines...) Expand all
239 ResourceProvider::ResourceId maskResourceId = maskLayer ? maskLayer->content sResourceId() : 0; 239 ResourceProvider::ResourceId maskResourceId = maskLayer ? maskLayer->content sResourceId() : 0;
240 gfx::Rect contentsChangedSinceLastFrame = contentsChanged() ? m_contentRect : gfx::Rect(); 240 gfx::Rect contentsChangedSinceLastFrame = contentsChanged() ? m_contentRect : gfx::Rect();
241 241
242 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create(); 242 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create();
243 quad->SetNew(sharedQuadState, contentRect(), renderPassId, forReplica, maskR esourceId, contentsChangedSinceLastFrame, 243 quad->SetNew(sharedQuadState, contentRect(), renderPassId, forReplica, maskR esourceId, contentsChangedSinceLastFrame,
244 maskTexCoordScaleX, maskTexCoordScaleY, maskTexCoordOffsetX, ma skTexCoordOffsetY); 244 maskTexCoordScaleX, maskTexCoordScaleY, maskTexCoordOffsetX, ma skTexCoordOffsetY);
245 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData); 245 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
246 } 246 }
247 247
248 } // namespace cc 248 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quad_culler.cc ('k') | cc/tiled_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698