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: content/common/gpu/texture_image_transport_surface.cc

Issue 15689003: Part 3/3 (RWH/IOSurface) of adding with device scale factor to transport surfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missed lines Created 7 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "content/common/gpu/texture_image_transport_surface.h" 5 #include "content/common/gpu/texture_image_transport_surface.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 return true; 207 return true;
208 208
209 if (!backbuffer_->service_id()) { 209 if (!backbuffer_->service_id()) {
210 LOG(ERROR) << "Swap without valid backing."; 210 LOG(ERROR) << "Swap without valid backing.";
211 return true; 211 return true;
212 } 212 }
213 213
214 DCHECK(backbuffer_size() == current_size_); 214 DCHECK(backbuffer_size() == current_size_);
215 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params; 215 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params;
216 params.size = backbuffer_size(); 216 params.size = backbuffer_size();
217 params.scale_factor = scale_factor_;
217 params.mailbox_name.assign( 218 params.mailbox_name.assign(
218 reinterpret_cast<const char*>(&mailbox_name_), sizeof(mailbox_name_)); 219 reinterpret_cast<const char*>(&mailbox_name_), sizeof(mailbox_name_));
219 220
220 glFlush(); 221 glFlush();
221 ProduceTexture(); 222 ProduceTexture();
222 223
223 // Do not allow destruction while we are still waiting for a swap ACK, 224 // Do not allow destruction while we are still waiting for a swap ACK,
224 // so we do not leak a texture in the mailbox. 225 // so we do not leak a texture in the mailbox.
225 AddRef(); 226 AddRef();
226 227
(...skipping 18 matching lines...) Expand all
245 return true; 246 return true;
246 247
247 if (!backbuffer_->service_id()) { 248 if (!backbuffer_->service_id()) {
248 LOG(ERROR) << "Swap without valid backing."; 249 LOG(ERROR) << "Swap without valid backing.";
249 return true; 250 return true;
250 } 251 }
251 252
252 DCHECK(current_size_ == backbuffer_size()); 253 DCHECK(current_size_ == backbuffer_size());
253 GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params params; 254 GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params params;
254 params.surface_size = backbuffer_size(); 255 params.surface_size = backbuffer_size();
256 params.surface_scale_factor = scale_factor_;
255 params.x = x; 257 params.x = x;
256 params.y = y; 258 params.y = y;
257 params.width = width; 259 params.width = width;
258 params.height = height; 260 params.height = height;
259 params.mailbox_name.assign( 261 params.mailbox_name.assign(
260 reinterpret_cast<const char*>(&mailbox_name_), sizeof(mailbox_name_)); 262 reinterpret_cast<const char*>(&mailbox_name_), sizeof(mailbox_name_));
261 263
262 glFlush(); 264 glFlush();
263 ProduceTexture(); 265 ProduceTexture();
264 266
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 GL_TEXTURE_2D, 499 GL_TEXTURE_2D,
498 mailbox_name_, 500 mailbox_name_,
499 backbuffer_.release(), 501 backbuffer_.release(),
500 NULL); 502 NULL);
501 DCHECK(success); 503 DCHECK(success);
502 mailbox_name_ = MailboxName(); 504 mailbox_name_ = MailboxName();
503 backbuffer_.reset(CreateTextureDefinition(gfx::Size(), 0)); 505 backbuffer_.reset(CreateTextureDefinition(gfx::Size(), 0));
504 } 506 }
505 507
506 } // namespace content 508 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698