OLD | NEW |
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 "services/ui/demo/bitmap_uploader.h" | 5 #include "services/ui/demo/bitmap_uploader.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 const cc::RenderPassId render_pass_id(1, 1); | 85 const cc::RenderPassId render_pass_id(1, 1); |
86 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); | 86 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); |
87 pass->SetAll(render_pass_id, bounds, bounds, gfx::Transform(), | 87 pass->SetAll(render_pass_id, bounds, bounds, gfx::Transform(), |
88 true /* has_transparent_background */); | 88 true /* has_transparent_background */); |
89 | 89 |
90 // The SharedQuadState is owned by the SharedQuadStateList | 90 // The SharedQuadState is owned by the SharedQuadStateList |
91 // shared_quad_state_list. | 91 // shared_quad_state_list. |
92 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); | 92 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); |
93 sqs->SetAll(gfx::Transform(), bounds.size(), bounds, bounds, | 93 sqs->SetAll(gfx::Transform(), bounds.size(), bounds, bounds, |
94 false /* is_clipped */, 1.f /* opacity */, SkXfermode::kSrc_Mode, | 94 false /* is_clipped */, 1.f /* opacity */, SkBlendMode::kSrc, |
95 0 /* sorting_context_id */); | 95 0 /* sorting_context_id */); |
96 | 96 |
97 if (bitmap_.get()) { | 97 if (bitmap_.get()) { |
98 gpu::gles2::GLES2Interface* gl = | 98 gpu::gles2::GLES2Interface* gl = |
99 compositor_frame_sink_->context_provider()->ContextGL(); | 99 compositor_frame_sink_->context_provider()->ContextGL(); |
100 gfx::Size bitmap_size(width_, height_); | 100 gfx::Size bitmap_size(width_, height_); |
101 GLuint texture_id = BindTextureForSize(bitmap_size); | 101 GLuint texture_id = BindTextureForSize(bitmap_size); |
102 gl->TexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, bitmap_size.width(), | 102 gl->TexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, bitmap_size.width(), |
103 bitmap_size.height(), TextureFormat(), GL_UNSIGNED_BYTE, | 103 bitmap_size.height(), TextureFormat(), GL_UNSIGNED_BYTE, |
104 &((*bitmap_)[0])); | 104 &((*bitmap_)[0])); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 // TODO(fsamuel): Implement this. | 235 // TODO(fsamuel): Implement this. |
236 } | 236 } |
237 | 237 |
238 void BitmapUploader::SetExternalTilePriorityConstraints( | 238 void BitmapUploader::SetExternalTilePriorityConstraints( |
239 const gfx::Rect& viewport_rect, | 239 const gfx::Rect& viewport_rect, |
240 const gfx::Transform& transform) { | 240 const gfx::Transform& transform) { |
241 // TODO(fsamuel): Implement this. | 241 // TODO(fsamuel): Implement this. |
242 } | 242 } |
243 | 243 |
244 } // namespace ui | 244 } // namespace ui |
OLD | NEW |