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