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

Side by Side Diff: cc/render_surface_impl.cc

Issue 11365239: cc: Add support for debugging layer borders directly in the compositor (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/render_pass.cc ('k') | cc/tiled_layer_impl.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 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 void RenderSurfaceImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQ uadsData, bool forReplica, RenderPass::Id renderPassId) 203 void RenderSurfaceImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQ uadsData, bool forReplica, RenderPass::Id renderPassId)
204 { 204 {
205 DCHECK(!forReplica || m_owningLayer->hasReplica()); 205 DCHECK(!forReplica || m_owningLayer->hasReplica());
206 206
207 gfx::Rect clippedRectInTarget = computeClippedRectInTarget(m_owningLayer); 207 gfx::Rect clippedRectInTarget = computeClippedRectInTarget(m_owningLayer);
208 bool isOpaque = false; 208 bool isOpaque = false;
209 const WebTransformationMatrix& drawTransform = forReplica ? m_replicaDrawTra nsform : m_drawTransform; 209 const WebTransformationMatrix& drawTransform = forReplica ? m_replicaDrawTra nsform : m_drawTransform;
210 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(SharedQuadSta te::create(drawTransform, m_contentRect, clippedRectInTarget, m_drawOpacity, isO paque).Pass()); 210 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(SharedQuadSta te::create(drawTransform, m_contentRect, clippedRectInTarget, m_drawOpacity, isO paque).Pass());
211 211
212 if (m_owningLayer->hasDebugBorders()) { 212 if (m_owningLayer->showDebugBorders()) {
213 int red = forReplica ? debugReplicaBorderColorRed : debugSurfaceBorderCo lorRed; 213 int red = forReplica ? debugReplicaBorderColorRed : debugSurfaceBorderCo lorRed;
214 int green = forReplica ? debugReplicaBorderColorGreen : debugSurfaceBor derColorGreen; 214 int green = forReplica ? debugReplicaBorderColorGreen : debugSurfaceBor derColorGreen;
215 int blue = forReplica ? debugReplicaBorderColorBlue : debugSurfaceBorder ColorBlue; 215 int blue = forReplica ? debugReplicaBorderColorBlue : debugSurfaceBorder ColorBlue;
216 SkColor color = SkColorSetARGB(debugSurfaceBorderAlpha, red, green, blue ); 216 SkColor color = SkColorSetARGB(debugSurfaceBorderAlpha, red, green, blue );
217 quadSink.append(DebugBorderDrawQuad::create(sharedQuadState, contentRect (), color, debugSurfaceBorderWidth).PassAs<DrawQuad>(), appendQuadsData); 217 quadSink.append(DebugBorderDrawQuad::create(sharedQuadState, contentRect (), color, debugSurfaceBorderWidth).PassAs<DrawQuad>(), appendQuadsData);
218 } 218 }
219 219
220 // FIXME: By using the same RenderSurfaceImpl for both the content and its r eflection, 220 // FIXME: By using the same RenderSurfaceImpl for both the content and its r eflection,
221 // it's currently not possible to apply a separate mask to the reflection la yer 221 // it's currently not possible to apply a separate mask to the reflection la yer
222 // or correctly handle opacity in reflections (opacity must be applied after drawing 222 // or correctly handle opacity in reflections (opacity must be applied after drawing
(...skipping 22 matching lines...) Expand all
245 } 245 }
246 246
247 ResourceProvider::ResourceId maskResourceId = maskLayer ? maskLayer->content sResourceId() : 0; 247 ResourceProvider::ResourceId maskResourceId = maskLayer ? maskLayer->content sResourceId() : 0;
248 gfx::Rect contentsChangedSinceLastFrame = contentsChanged() ? m_contentRect : gfx::Rect(); 248 gfx::Rect contentsChangedSinceLastFrame = contentsChanged() ? m_contentRect : gfx::Rect();
249 249
250 quadSink.append(RenderPassDrawQuad::create(sharedQuadState, contentRect(), r enderPassId, forReplica, maskResourceId, contentsChangedSinceLastFrame, 250 quadSink.append(RenderPassDrawQuad::create(sharedQuadState, contentRect(), r enderPassId, forReplica, maskResourceId, contentsChangedSinceLastFrame,
251 maskTexCoordScaleX, maskTexCoor dScaleY, maskTexCoordOffsetX, maskTexCoordOffsetY).PassAs<DrawQuad>(), appendQua dsData); 251 maskTexCoordScaleX, maskTexCoor dScaleY, maskTexCoordOffsetX, maskTexCoordOffsetY).PassAs<DrawQuad>(), appendQua dsData);
252 } 252 }
253 253
254 } // namespace cc 254 } // namespace cc
OLDNEW
« no previous file with comments | « cc/render_pass.cc ('k') | cc/tiled_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698