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

Side by Side Diff: content/common/gpu/image_transport_surface_calayer_mac.mm

Issue 696823002: Fix content scaling bug on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « content/common/gpu/OWNERS ('k') | content/common/gpu/image_transport_surface_fbo_mac.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/image_transport_surface_calayer_mac.h" 5 #include "content/common/gpu/image_transport_surface_calayer_mac.h"
6 6
7 #include <OpenGL/CGLRenderers.h> 7 #include <OpenGL/CGLRenderers.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/mac/sdk_forward_declarations.h" 10 #include "base/mac/sdk_forward_declarations.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 GL_RGBA, 124 GL_RGBA,
125 GL_UNSIGNED_BYTE, 125 GL_UNSIGNED_BYTE,
126 NULL); 126 NULL);
127 error = glGetError(); 127 error = glGetError();
128 if (error != GL_NO_ERROR) { 128 if (error != GL_NO_ERROR) {
129 DLOG(ERROR) << "glTexImage failed with GL error: " << error; 129 DLOG(ERROR) << "glTexImage failed with GL error: " << error;
130 return false; 130 return false;
131 } 131 }
132 glFlush(); 132 glFlush();
133 133
134 // Disable the fade-in animation as the layer is changed.
135 ScopedCAActionDisabler disabler;
136
137 // Set the parameters that will be used to allocate the CALayer to draw the 134 // Set the parameters that will be used to allocate the CALayer to draw the
138 // texture into. 135 // texture into.
139 share_group_context_.reset(CGLRetainContext(context)); 136 share_group_context_.reset(CGLRetainContext(context));
140 fbo_texture_ = texture; 137 fbo_texture_ = texture;
141 fbo_pixel_size_ = pixel_size; 138 fbo_pixel_size_ = pixel_size;
142 fbo_scale_factor_ = scale_factor; 139 fbo_scale_factor_ = scale_factor;
143 return true; 140 return true;
144 } 141 }
145 142
146 void CALayerStorageProvider::FreeColorBufferStorage() { 143 void CALayerStorageProvider::FreeColorBufferStorage() {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 return; 317 return;
321 pending_draw_weak_factory_.InvalidateWeakPtrs(); 318 pending_draw_weak_factory_.InvalidateWeakPtrs();
322 has_pending_draw_ = false; 319 has_pending_draw_ = false;
323 transport_surface_->SendSwapBuffers( 320 transport_surface_->SendSwapBuffers(
324 SurfaceHandleFromCAContextID([context_ contextId]), 321 SurfaceHandleFromCAContextID([context_ contextId]),
325 fbo_pixel_size_, 322 fbo_pixel_size_,
326 fbo_scale_factor_); 323 fbo_scale_factor_);
327 } 324 }
328 325
329 } // namespace content 326 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/OWNERS ('k') | content/common/gpu/image_transport_surface_fbo_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698