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

Side by Side Diff: cc/resources/texture_mailbox.cc

Issue 145313006: [#7] Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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
« no previous file with comments | « cc/resources/texture_mailbox.h ('k') | cc/resources/tile.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/resources/texture_mailbox.h" 5 #include "cc/resources/texture_mailbox.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/khronos/GLES2/gl2.h" 8 #include "third_party/khronos/GLES2/gl2.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 TextureMailbox::TextureMailbox(const gpu::Mailbox& mailbox_name, 43 TextureMailbox::TextureMailbox(const gpu::Mailbox& mailbox_name,
44 unsigned texture_target, 44 unsigned texture_target,
45 unsigned sync_point) 45 unsigned sync_point)
46 : target_(texture_target), 46 : target_(texture_target),
47 sync_point_(sync_point), 47 sync_point_(sync_point),
48 shared_memory_(NULL) { 48 shared_memory_(NULL) {
49 name_.SetName(mailbox_name.name); 49 name_.SetName(mailbox_name.name);
50 } 50 }
51 51
52 TextureMailbox::TextureMailbox(base::SharedMemory* shared_memory, 52 TextureMailbox::TextureMailbox(base::SharedMemory* shared_memory,
53 gfx::Size size) 53 const gfx::Size& size)
54 : target_(GL_TEXTURE_2D), 54 : target_(GL_TEXTURE_2D),
55 sync_point_(0), 55 sync_point_(0),
56 shared_memory_(shared_memory), 56 shared_memory_(shared_memory),
57 shared_memory_size_(size) {} 57 shared_memory_size_(size) {}
58 58
59 TextureMailbox::~TextureMailbox() {} 59 TextureMailbox::~TextureMailbox() {}
60 60
61 bool TextureMailbox::Equals(const TextureMailbox& other) const { 61 bool TextureMailbox::Equals(const TextureMailbox& other) const {
62 if (other.IsTexture()) 62 if (other.IsTexture())
63 return ContainsMailbox(other.name()); 63 return ContainsMailbox(other.name());
(...skipping 15 matching lines...) Expand all
79 void TextureMailbox::SetName(const gpu::Mailbox& name) { 79 void TextureMailbox::SetName(const gpu::Mailbox& name) {
80 DCHECK(shared_memory_ == NULL); 80 DCHECK(shared_memory_ == NULL);
81 name_ = name; 81 name_ = name;
82 } 82 }
83 83
84 size_t TextureMailbox::shared_memory_size_in_bytes() const { 84 size_t TextureMailbox::shared_memory_size_in_bytes() const {
85 return 4 * shared_memory_size_.GetArea(); 85 return 4 * shared_memory_size_.GetArea();
86 } 86 }
87 87
88 } // namespace cc 88 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/texture_mailbox.h ('k') | cc/resources/tile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698