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

Side by Side Diff: content/browser/compositor/offscreen_browser_compositor_output_surface.cc

Issue 1900993002: Move SharedMemoryLimits out of WebGraphicsContext3DCommandBufferImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@limits
Patch Set: move-limits: types Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/compositor/offscreen_browser_compositor_output_surface .h" 5 #include "content/browser/compositor/offscreen_browser_compositor_output_surface .h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 56
57 void OffscreenBrowserCompositorOutputSurface::EnsureBackbuffer() { 57 void OffscreenBrowserCompositorOutputSurface::EnsureBackbuffer() {
58 is_backbuffer_discarded_ = false; 58 is_backbuffer_discarded_ = false;
59 59
60 if (!reflector_texture_.get()) { 60 if (!reflector_texture_.get()) {
61 reflector_texture_.reset(new ReflectorTexture(context_provider())); 61 reflector_texture_.reset(new ReflectorTexture(context_provider()));
62 62
63 GLES2Interface* gl = context_provider_->ContextGL(); 63 GLES2Interface* gl = context_provider_->ContextGL();
64 64
65 int max_texture_size = 65 const int max_texture_size =
66 context_provider_->ContextCapabilities().gpu.max_texture_size; 66 context_provider_->ContextCapabilities().max_texture_size;
67 int texture_width = std::min(max_texture_size, surface_size_.width()); 67 int texture_width = std::min(max_texture_size, surface_size_.width());
68 int texture_height = std::min(max_texture_size, surface_size_.height()); 68 int texture_height = std::min(max_texture_size, surface_size_.height());
69 69
70 cc::ResourceFormat format = cc::RGBA_8888; 70 cc::ResourceFormat format = cc::RGBA_8888;
71 gl->BindTexture(GL_TEXTURE_2D, reflector_texture_->texture_id()); 71 gl->BindTexture(GL_TEXTURE_2D, reflector_texture_->texture_id());
72 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 72 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
73 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 73 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
74 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 74 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
75 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 75 gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
76 gl->TexImage2D(GL_TEXTURE_2D, 0, GLInternalFormat(format), 76 gl->TexImage2D(GL_TEXTURE_2D, 0, GLInternalFormat(format),
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 #if defined(OS_MACOSX) 168 #if defined(OS_MACOSX)
169 169
170 bool OffscreenBrowserCompositorOutputSurface:: 170 bool OffscreenBrowserCompositorOutputSurface::
171 SurfaceShouldNotShowFramesAfterSuspendForRecycle() const { 171 SurfaceShouldNotShowFramesAfterSuspendForRecycle() const {
172 return true; 172 return true;
173 } 173 }
174 174
175 #endif 175 #endif
176 176
177 } // namespace content 177 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/gpu_process_transport_factory.cc ('k') | content/browser/gpu/gpu_ipc_browsertests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698