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

Side by Side Diff: cc/layers/io_surface_layer_impl.cc

Issue 14098007: cc: Add a test that the IOSurface drawing path makes the right context calls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | « no previous file | cc/trees/layer_tree_host_unittest.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 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/layers/io_surface_layer_impl.h" 5 #include "cc/layers/io_surface_layer_impl.h"
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "cc/layers/quad_sink.h" 8 #include "cc/layers/quad_sink.h"
9 #include "cc/output/gl_renderer.h" // For the GLC() macro. 9 #include "cc/output/gl_renderer.h" // For the GLC() macro.
10 #include "cc/output/output_surface.h" 10 #include "cc/output/output_surface.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 // FIXME: Do this in a way that we can track memory usage. 75 // FIXME: Do this in a way that we can track memory usage.
76 if (!io_surface_texture_id_) { 76 if (!io_surface_texture_id_) {
77 io_surface_texture_id_ = context3d->createTexture(); 77 io_surface_texture_id_ = context3d->createTexture();
78 io_surface_resource_id_ = 78 io_surface_resource_id_ =
79 resource_provider->CreateResourceFromExternalTexture( 79 resource_provider->CreateResourceFromExternalTexture(
80 GL_TEXTURE_RECTANGLE_ARB, 80 GL_TEXTURE_RECTANGLE_ARB,
81 io_surface_texture_id_); 81 io_surface_texture_id_);
82 } 82 }
83 83
84 GLC(context3d, context3d->activeTexture(GL_TEXTURE0));
jamesr 2013/04/19 00:05:09 what was the actual bug? this call?
danakj 2013/04/19 00:06:41 mac context virtualization is the bug on TOT. the
danakj 2013/04/19 00:07:05 I think this call is just redundant cuz we're alwa
85 GLC(context3d, 84 GLC(context3d,
86 context3d->bindTexture(GL_TEXTURE_RECTANGLE_ARB, 85 context3d->bindTexture(GL_TEXTURE_RECTANGLE_ARB,
87 io_surface_texture_id_)); 86 io_surface_texture_id_));
88 GLC(context3d,
89 context3d->texParameteri(
90 GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
91 GLC(context3d,
92 context3d->texParameteri(
93 GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
94 GLC(context3d,
95 context3d->texParameteri(
96 GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
97 GLC(context3d,
98 context3d->texParameteri(
99 GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
100 context3d->texImageIOSurface2DCHROMIUM(GL_TEXTURE_RECTANGLE_ARB, 87 context3d->texImageIOSurface2DCHROMIUM(GL_TEXTURE_RECTANGLE_ARB,
101 io_surface_size_.width(), 88 io_surface_size_.width(),
102 io_surface_size_.height(), 89 io_surface_size_.height(),
103 io_surface_id_, 90 io_surface_id_,
104 0); 91 0);
105 // Do not check for error conditions. texImageIOSurface2DCHROMIUM() is 92 // Do not check for error conditions. texImageIOSurface2DCHROMIUM() is
106 // supposed to hold on to the last good IOSurface if the new one is already 93 // supposed to hold on to the last good IOSurface if the new one is already
107 // closed. This is only a possibility during live resizing of plugins. 94 // closed. This is only a possibility during live resizing of plugins.
108 // However, it seems that this is not sufficient to completely guard against 95 // However, it seems that this is not sufficient to completely guard against
109 // garbage being drawn. If this is found to be a significant issue, it may 96 // garbage being drawn. If this is found to be a significant issue, it may
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 142
156 io_surface_id_ = io_surface_id; 143 io_surface_id_ = io_surface_id;
157 io_surface_size_ = size; 144 io_surface_size_ = size;
158 } 145 }
159 146
160 const char* IOSurfaceLayerImpl::LayerTypeAsString() const { 147 const char* IOSurfaceLayerImpl::LayerTypeAsString() const {
161 return "IOSurfaceLayer"; 148 return "IOSurfaceLayer";
162 } 149 }
163 150
164 } // namespace cc 151 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698