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/common/gpu/client/gl_helper_scaling.h" | 5 #include "content/common/gpu/client/gl_helper_scaling.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/debug/trace_event.h" | 12 #include "base/debug/trace_event.h" |
13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "gpu/command_buffer/client/gles2_interface.h" | 18 #include "gpu/command_buffer/client/gles2_interface.h" |
19 #include "third_party/skia/include/core/SkRegion.h" | 19 #include "third_party/skia/include/core/SkRegion.h" |
20 #include "ui/gfx/rect.h" | 20 #include "ui/gfx/geometry/rect.h" |
21 #include "ui/gfx/size.h" | 21 #include "ui/gfx/size.h" |
22 | 22 |
23 using gpu::gles2::GLES2Interface; | 23 using gpu::gles2::GLES2Interface; |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 | 26 |
27 GLHelperScaling::GLHelperScaling(GLES2Interface* gl, GLHelper* helper) | 27 GLHelperScaling::GLHelperScaling(GLES2Interface* gl, GLHelper* helper) |
28 : gl_(gl), helper_(helper), vertex_attributes_buffer_(gl_) { | 28 : gl_(gl), helper_(helper), vertex_attributes_buffer_(gl_) { |
29 InitBuffer(); | 29 InitBuffer(); |
30 } | 30 } |
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 gl_->Uniform2f(dst_pixelsize_location_, | 920 gl_->Uniform2f(dst_pixelsize_location_, |
921 static_cast<float>(dst_size.width()), | 921 static_cast<float>(dst_size.width()), |
922 static_cast<float>(dst_size.height())); | 922 static_cast<float>(dst_size.height())); |
923 | 923 |
924 gl_->Uniform2f( | 924 gl_->Uniform2f( |
925 scaling_vector_location_, scale_x ? 1.0 : 0.0, scale_x ? 0.0 : 1.0); | 925 scaling_vector_location_, scale_x ? 1.0 : 0.0, scale_x ? 0.0 : 1.0); |
926 gl_->Uniform4fv(color_weights_location_, 1, color_weights); | 926 gl_->Uniform4fv(color_weights_location_, 1, color_weights); |
927 } | 927 } |
928 | 928 |
929 } // namespace content | 929 } // namespace content |
OLD | NEW |