OLD | NEW |
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/browser/compositor/gl_helper_scaling.h" | 5 #include "components/display_compositor/gl_helper_scaling.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
18 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 #include "base/trace_event/trace_event.h" | 20 #include "base/trace_event/trace_event.h" |
21 #include "gpu/command_buffer/client/gles2_interface.h" | 21 #include "gpu/command_buffer/client/gles2_interface.h" |
22 #include "third_party/skia/include/core/SkRegion.h" | 22 #include "third_party/skia/include/core/SkRegion.h" |
23 #include "ui/gfx/geometry/rect.h" | 23 #include "ui/gfx/geometry/rect.h" |
24 #include "ui/gfx/geometry/size.h" | 24 #include "ui/gfx/geometry/size.h" |
25 | 25 |
26 using gpu::gles2::GLES2Interface; | 26 using gpu::gles2::GLES2Interface; |
27 | 27 |
28 namespace content { | 28 namespace display_compositor { |
29 | 29 |
30 GLHelperScaling::GLHelperScaling(GLES2Interface* gl, GLHelper* helper) | 30 GLHelperScaling::GLHelperScaling(GLES2Interface* gl, GLHelper* helper) |
31 : gl_(gl), helper_(helper), vertex_attributes_buffer_(gl_) { | 31 : gl_(gl), helper_(helper), vertex_attributes_buffer_(gl_) { |
32 InitBuffer(); | 32 InitBuffer(); |
33 } | 33 } |
34 | 34 |
35 GLHelperScaling::~GLHelperScaling() {} | 35 GLHelperScaling::~GLHelperScaling() {} |
36 | 36 |
37 // Used to keep track of a generated shader program. The program | 37 // Used to keep track of a generated shader program. The program |
38 // is passed in as text through Setup and is used by calling | 38 // is passed in as text through Setup and is used by calling |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 | 871 |
872 gl_->Uniform2f(src_pixelsize_location_, src_size.width(), src_size.height()); | 872 gl_->Uniform2f(src_pixelsize_location_, src_size.width(), src_size.height()); |
873 gl_->Uniform2f(dst_pixelsize_location_, static_cast<float>(dst_size.width()), | 873 gl_->Uniform2f(dst_pixelsize_location_, static_cast<float>(dst_size.width()), |
874 static_cast<float>(dst_size.height())); | 874 static_cast<float>(dst_size.height())); |
875 | 875 |
876 gl_->Uniform2f(scaling_vector_location_, scale_x ? 1.0 : 0.0, | 876 gl_->Uniform2f(scaling_vector_location_, scale_x ? 1.0 : 0.0, |
877 scale_x ? 0.0 : 1.0); | 877 scale_x ? 0.0 : 1.0); |
878 gl_->Uniform4fv(color_weights_location_, 1, color_weights); | 878 gl_->Uniform4fv(color_weights_location_, 1, color_weights); |
879 } | 879 } |
880 | 880 |
881 } // namespace content | 881 } // namespace display_compositor |
OLD | NEW |