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

Side by Side Diff: ui/compositor/compositor.cc

Issue 10941017: Change the scale factor of texture_size from the layer's one to an estimation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | « ui/compositor/compositor.h ('k') | ui/compositor/layer.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 (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 "ui/compositor/compositor.h" 5 #include "ui/compositor/compositor.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 if (!offscreen) { 117 if (!offscreen) {
118 context->makeContextCurrent(); 118 context->makeContextCurrent();
119 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); 119 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent();
120 bool vsync = !command_line->HasSwitch(switches::kDisableUIVsync); 120 bool vsync = !command_line->HasSwitch(switches::kDisableUIVsync);
121 gl_context->SetSwapInterval(vsync ? 1 : 0); 121 gl_context->SetSwapInterval(vsync ? 1 : 0);
122 gl_context->ReleaseCurrent(NULL); 122 gl_context->ReleaseCurrent(NULL);
123 } 123 }
124 return context; 124 return context;
125 } 125 }
126 126
127 Texture::Texture(bool flipped, const gfx::Size& size) 127 Texture::Texture(bool flipped, const gfx::Size& size, float device_scale_factor)
128 : texture_id_(0), 128 : texture_id_(0),
129 flipped_(flipped), 129 flipped_(flipped),
130 size_(size) { 130 size_(size),
131 device_scale_factor_(device_scale_factor) {
131 } 132 }
132 133
133 Texture::~Texture() { 134 Texture::~Texture() {
134 } 135 }
135 136
136 Compositor::Compositor(CompositorDelegate* delegate, 137 Compositor::Compositor(CompositorDelegate* delegate,
137 gfx::AcceleratedWidget widget) 138 gfx::AcceleratedWidget widget)
138 : delegate_(delegate), 139 : delegate_(delegate),
139 root_layer_(NULL), 140 root_layer_(NULL),
140 widget_(widget), 141 widget_(widget),
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 432
432 COMPOSITOR_EXPORT void DisableTestCompositor() { 433 COMPOSITOR_EXPORT void DisableTestCompositor() {
433 test_compositor_enabled = false; 434 test_compositor_enabled = false;
434 } 435 }
435 436
436 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { 437 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() {
437 return test_compositor_enabled; 438 return test_compositor_enabled;
438 } 439 }
439 440
440 } // namespace ui 441 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/compositor.h ('k') | ui/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698