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

Side by Side Diff: cc/texture_layer_impl.cc

Issue 11418297: Clipping textured quads explicitly without scissoring (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: using static cast 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
« cc/texture_draw_quad.cc ('K') | « cc/texture_draw_quad.cc ('k') | no next file » | 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/texture_layer_impl.h" 5 #include "cc/texture_layer_impl.h"
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "cc/quad_sink.h" 8 #include "cc/quad_sink.h"
9 #include "cc/renderer.h" 9 #include "cc/renderer.h"
10 #include "cc/texture_draw_quad.h" 10 #include "cc/texture_draw_quad.h"
(...skipping 27 matching lines...) Expand all
38 if (!m_externalTextureResource) 38 if (!m_externalTextureResource)
39 return; 39 return;
40 40
41 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ uadState()); 41 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ uadState());
42 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData); 42 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData);
43 43
44 gfx::Rect quadRect(gfx::Point(), contentBounds()); 44 gfx::Rect quadRect(gfx::Point(), contentBounds());
45 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect()); 45 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect());
46 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create(); 46 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create();
47 quad->SetNew(sharedQuadState, quadRect, opaqueRect, m_externalTextureResourc e, m_premultipliedAlpha, m_uvRect, m_flipped); 47 quad->SetNew(sharedQuadState, quadRect, opaqueRect, m_externalTextureResourc e, m_premultipliedAlpha, m_uvRect, m_flipped);
48 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData); 48
49 // Perform explicit clipping on a quad to avoid setting a scissor later.
50 if (sharedQuadState->is_clipped && quad->PerformClipping())
51 sharedQuadState->is_clipped = false;
52 if (!quad->rect.IsEmpty())
53 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
49 } 54 }
50 55
51 void TextureLayerImpl::didDraw(ResourceProvider* resourceProvider) 56 void TextureLayerImpl::didDraw(ResourceProvider* resourceProvider)
52 { 57 {
53 if (!m_externalTextureResource) 58 if (!m_externalTextureResource)
54 return; 59 return;
55 // FIXME: the following assert will not be true when sending resources to a 60 // FIXME: the following assert will not be true when sending resources to a
56 // parent compositor. A synchronization scheme (double-buffering or 61 // parent compositor. A synchronization scheme (double-buffering or
57 // pipelining of updates) for the client will need to exist to solve this. 62 // pipelining of updates) for the client will need to exist to solve this.
58 DCHECK(!resourceProvider->inUseByConsumer(m_externalTextureResource)); 63 DCHECK(!resourceProvider->inUseByConsumer(m_externalTextureResource));
(...skipping 13 matching lines...) Expand all
72 m_textureId = 0; 77 m_textureId = 0;
73 m_externalTextureResource = 0; 78 m_externalTextureResource = 0;
74 } 79 }
75 80
76 const char* TextureLayerImpl::layerTypeAsString() const 81 const char* TextureLayerImpl::layerTypeAsString() const
77 { 82 {
78 return "TextureLayer"; 83 return "TextureLayer";
79 } 84 }
80 85
81 } // namespace cc 86 } // namespace cc
OLDNEW
« cc/texture_draw_quad.cc ('K') | « cc/texture_draw_quad.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698