| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010, Google Inc. | 2 * Copyright 2010, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 DCHECK_NE(format, Texture::UNKNOWN_FORMAT); | 62 DCHECK_NE(format, Texture::UNKNOWN_FORMAT); |
| 63 } | 63 } |
| 64 | 64 |
| 65 // Creates a new texture object from scratch. | 65 // Creates a new texture object from scratch. |
| 66 TextureCairo* TextureCairo::Create(ServiceLocator* service_locator, | 66 TextureCairo* TextureCairo::Create(ServiceLocator* service_locator, |
| 67 Texture::Format format, | 67 Texture::Format format, |
| 68 int levels, | 68 int levels, |
| 69 int width, | 69 int width, |
| 70 int height, | 70 int height, |
| 71 bool enable_render_surfaces) { | 71 bool enable_render_surfaces) { |
| 72 DLOG(INFO) << "Texture2DCairo Create"; | |
| 73 TextureCairo* texture = new TextureCairo(service_locator, | 72 TextureCairo* texture = new TextureCairo(service_locator, |
| 74 format, | 73 format, |
| 75 levels, | 74 levels, |
| 76 width, | 75 width, |
| 77 height, | 76 height, |
| 78 enable_render_surfaces); | 77 enable_render_surfaces); |
| 79 return texture; | 78 return texture; |
| 80 } | 79 } |
| 81 | 80 |
| 82 // In 2D: is not really used | 81 // In 2D: is not really used |
| 83 const Texture::RGBASwizzleIndices& TextureCairo::GetABGR32FSwizzleIndices() { | 82 const Texture::RGBASwizzleIndices& TextureCairo::GetABGR32FSwizzleIndices() { |
| 84 NOTIMPLEMENTED(); | 83 NOTIMPLEMENTED(); |
| 85 return g_gl_abgr32f_swizzle_indices; | 84 return g_gl_abgr32f_swizzle_indices; |
| 86 } | 85 } |
| 87 | 86 |
| 88 TextureCairo::~TextureCairo() { | 87 TextureCairo::~TextureCairo() { |
| 88 renderer_ = NULL; |
| 89 DLOG(INFO) << "Texture2DCairo Destruct"; | 89 DLOG(INFO) << "Texture2DCairo Destruct"; |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Set the image data to the renderer | 92 // Set the image data to the renderer |
| 93 void TextureCairo::SetRect(int level, | 93 void TextureCairo::SetRect(int level, |
| 94 unsigned dst_left, | 94 unsigned dst_left, |
| 95 unsigned dst_top, | 95 unsigned dst_top, |
| 96 unsigned src_width, | 96 unsigned src_width, |
| 97 unsigned src_height, | 97 unsigned src_height, |
| 98 const void* src_data, | 98 const void* src_data, |
| 99 int src_pitch) { | 99 int src_pitch) { |
| 100 DLOG(INFO) << "Texture2DCairo SetRect"; | 100 DLOG(INFO) << "Texture2DCairo SetRect"; |
| 101 | 101 |
| 102 renderer_->SetNewFrame(src_data, | 102 resource_.data = src_data; |
| 103 src_width, src_height, | 103 resource_.left = dst_left; |
| 104 src_pitch); | 104 resource_.top = dst_top; |
| 105 resource_.width = src_width; |
| 106 resource_.height = src_height; |
| 107 resource_.pitch = src_pitch; |
| 108 } |
| 109 |
| 110 TextureResource* TextureCairo::GetResource() { |
| 111 DLOG(INFO) << "Texture2DCairo Get Resource"; |
| 112 return &resource_; |
| 105 } | 113 } |
| 106 | 114 |
| 107 // Locks the given mipmap level of this texture for loading from main memory, | 115 // Locks the given mipmap level of this texture for loading from main memory, |
| 108 // and returns a pointer to the buffer. | 116 // and returns a pointer to the buffer. |
| 109 bool TextureCairo::PlatformSpecificLock( | 117 bool TextureCairo::PlatformSpecificLock( |
| 110 int level, void** data, int* pitch, Texture::AccessMode mode) { | 118 int level, void** data, int* pitch, Texture::AccessMode mode) { |
| 111 NOTIMPLEMENTED(); | 119 NOTIMPLEMENTED(); |
| 112 return true; | 120 return true; |
| 113 } | 121 } |
| 114 | 122 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 130 } | 138 } |
| 131 | 139 |
| 132 // Returns the implementation-specific texture handle for this texture. | 140 // Returns the implementation-specific texture handle for this texture. |
| 133 void* TextureCairo::GetTextureHandle() const { | 141 void* TextureCairo::GetTextureHandle() const { |
| 134 NOTIMPLEMENTED(); | 142 NOTIMPLEMENTED(); |
| 135 return reinterpret_cast<void*>(NULL); | 143 return reinterpret_cast<void*>(NULL); |
| 136 } | 144 } |
| 137 | 145 |
| 138 } // namespace o3d | 146 } // namespace o3d |
| 139 | 147 |
| OLD | NEW |