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

Side by Side Diff: cc/io_surface_layer_impl.cc

Issue 11882037: Activate LayerImpl tree with sync+push instead of pointer swap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
« no previous file with comments | « cc/io_surface_layer_impl.h ('k') | cc/layer.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 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/io_surface_layer_impl.h" 5 #include "cc/io_surface_layer_impl.h"
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "cc/gl_renderer.h" // For the GLC() macro. 8 #include "cc/gl_renderer.h" // For the GLC() macro.
9 #include "cc/io_surface_draw_quad.h" 9 #include "cc/io_surface_draw_quad.h"
10 #include "cc/layer_tree_impl.h" 10 #include "cc/layer_tree_impl.h"
(...skipping 19 matching lines...) Expand all
30 if (!m_ioSurfaceTextureId) 30 if (!m_ioSurfaceTextureId)
31 return; 31 return;
32 32
33 OutputSurface* outputSurface = layerTreeImpl()->output_surface(); 33 OutputSurface* outputSurface = layerTreeImpl()->output_surface();
34 // FIXME: Implement this path for software compositing. 34 // FIXME: Implement this path for software compositing.
35 WebKit::WebGraphicsContext3D* context3d = outputSurface->Context3D(); 35 WebKit::WebGraphicsContext3D* context3d = outputSurface->Context3D();
36 if (context3d) 36 if (context3d)
37 context3d->deleteTexture(m_ioSurfaceTextureId); 37 context3d->deleteTexture(m_ioSurfaceTextureId);
38 } 38 }
39 39
40 scoped_ptr<LayerImpl> IOSurfaceLayerImpl::createLayerImpl(LayerTreeImpl* treeImp l)
41 {
42 return IOSurfaceLayerImpl::create(treeImpl, id()).PassAs<LayerImpl>();
43 }
44
45 void IOSurfaceLayerImpl::pushPropertiesTo(LayerImpl* layer)
46 {
47 LayerImpl::pushPropertiesTo(layer);
48
49 IOSurfaceLayerImpl* ioSurfaceLayer = static_cast<IOSurfaceLayerImpl*>(layer) ;
50 ioSurfaceLayer->setIOSurfaceProperties(m_ioSurfaceId, m_ioSurfaceSize);
51 }
52
40 void IOSurfaceLayerImpl::willDraw(ResourceProvider* resourceProvider) 53 void IOSurfaceLayerImpl::willDraw(ResourceProvider* resourceProvider)
41 { 54 {
42 LayerImpl::willDraw(resourceProvider); 55 LayerImpl::willDraw(resourceProvider);
43 56
44 if (m_ioSurfaceChanged) { 57 if (m_ioSurfaceChanged) {
45 WebKit::WebGraphicsContext3D* context3d = resourceProvider->graphicsCont ext3D(); 58 WebKit::WebGraphicsContext3D* context3d = resourceProvider->graphicsCont ext3D();
46 if (!context3d) { 59 if (!context3d) {
47 // FIXME: Implement this path for software compositing. 60 // FIXME: Implement this path for software compositing.
48 return; 61 return;
49 } 62 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 m_ioSurfaceId = ioSurfaceId; 121 m_ioSurfaceId = ioSurfaceId;
109 m_ioSurfaceSize = size; 122 m_ioSurfaceSize = size;
110 } 123 }
111 124
112 const char* IOSurfaceLayerImpl::layerTypeAsString() const 125 const char* IOSurfaceLayerImpl::layerTypeAsString() const
113 { 126 {
114 return "IOSurfaceLayer"; 127 return "IOSurfaceLayer";
115 } 128 }
116 129
117 } // namespace cc 130 } // namespace cc
OLDNEW
« no previous file with comments | « cc/io_surface_layer_impl.h ('k') | cc/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698