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

Side by Side Diff: components/bitmap_uploader/bitmap_uploader.cc

Issue 2042643002: Implement cc::CompositorFrameMetadata StructTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Diff against LatencyInfo Created 4 years, 6 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 "components/bitmap_uploader/bitmap_uploader.h" 5 #include "components/bitmap_uploader/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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 if (surface_) 68 if (surface_)
69 Upload(); 69 Upload();
70 } 70 }
71 71
72 void BitmapUploader::Upload() { 72 void BitmapUploader::Upload() {
73 const gfx::Rect bounds(window_->bounds()); 73 const gfx::Rect bounds(window_->bounds());
74 mus::mojom::PassPtr pass = mojo::CreateDefaultPass(1, bounds); 74 mus::mojom::PassPtr pass = mojo::CreateDefaultPass(1, bounds);
75 mus::mojom::CompositorFramePtr frame = mus::mojom::CompositorFrame::New(); 75 mus::mojom::CompositorFramePtr frame = mus::mojom::CompositorFrame::New();
76 76
77 // TODO(rjkroege): Support device scale factor in PDF viewer 77 // TODO(rjkroege): Support device scale factor in PDF viewer
78 mus::mojom::CompositorFrameMetadataPtr meta = 78 cc::CompositorFrameMetadata meta;
yzshen1 2016/06/06 16:22:04 this variable is not used anymroe.
Fady Samuel 2016/06/06 20:00:11 Done.
79 mus::mojom::CompositorFrameMetadata::New(); 79 frame->metadata.device_scale_factor = 1.0f;
80 meta->device_scale_factor = 1.0f;
81 frame->metadata = std::move(meta);
82 80
83 frame->resources.resize(0u); 81 frame->resources.resize(0u);
84 82
85 pass->quads.resize(0u); 83 pass->quads.resize(0u);
86 pass->shared_quad_states.push_back(mojo::CreateDefaultSQS(bounds.size())); 84 pass->shared_quad_states.push_back(mojo::CreateDefaultSQS(bounds.size()));
87 85
88 if (bitmap_.get()) { 86 if (bitmap_.get()) {
89 gpu::gles2::GLES2Interface* gl = gles2_context_->interface(); 87 gpu::gles2::GLES2Interface* gl = gles2_context_->interface();
90 gfx::Size bitmap_size(width_, height_); 88 gfx::Size bitmap_size(width_, height_);
91 GLuint texture_id = BindTextureForSize(bitmap_size); 89 GLuint texture_id = BindTextureForSize(bitmap_size);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 DCHECK_EQ(1, resource.count); 206 DCHECK_EQ(1, resource.count);
209 gl->WaitSyncTokenCHROMIUM(resource.sync_token.GetConstData()); 207 gl->WaitSyncTokenCHROMIUM(resource.sync_token.GetConstData());
210 uint32_t texture_id = resource_to_texture_id_map_[resource.id]; 208 uint32_t texture_id = resource_to_texture_id_map_[resource.id];
211 DCHECK_NE(0u, texture_id); 209 DCHECK_NE(0u, texture_id);
212 resource_to_texture_id_map_.erase(resource.id); 210 resource_to_texture_id_map_.erase(resource.id);
213 gl->DeleteTextures(1, &texture_id); 211 gl->DeleteTextures(1, &texture_id);
214 } 212 }
215 } 213 }
216 214
217 } // namespace bitmap_uploader 215 } // namespace bitmap_uploader
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698